<!DOCTYPE HTML>
<html>
  <head>
    <meta charset="UTF-8">
    <title>TOMTOM</title>
    <script>
      // @JSON_VAR data
      var data = {
        "program": "Tomtom",
        "version": "5.0.2",
        "release": "Thu Aug 30 14:26:08 2018 -0700",
        "cmd": [
          "tomtom", "-oc", "tomtom/tomtom_meme_TCP7_1", "-dist", "pearson",
          "-no-ssc", "meme/meme-chip_TCP7_1/meme_out/meme.html",
          "/diska/database/jaspar/JASPAR2020_CORE_non-redundant_pfms_meme.txt"
        ],
        "options": {
          "strands": "both",
          "distance_measure": "pearson",
          "threshold_type": "qvalue",
          "threshold_value": 0.5,
          "background_source": "--query--"
        },
        "alphabet": {
          "name": "DNA",
          "like": "dna",
          "ncore": 4,
          "symbols": [
            {
              "symbol": "A",
              "name": "Adenine",
              "colour": "CC0000",
              "complement": "T"
            }, {
              "symbol": "C",
              "name": "Cytosine",
              "colour": "0000CC",
              "complement": "G"
            }, {
              "symbol": "G",
              "name": "Guanine",
              "colour": "FFB300",
              "complement": "C"
            }, {
              "symbol": "T",
              "aliases": "U",
              "name": "Thymine",
              "colour": "008000",
              "complement": "A"
            }, {
              "symbol": "N",
              "aliases": "X.",
              "name": "Any base",
              "equals": "ACGT"
            }, {
              "symbol": "V",
              "name": "Not T",
              "equals": "ACG"
            }, {
              "symbol": "H",
              "name": "Not G",
              "equals": "ACT"
            }, {
              "symbol": "D",
              "name": "Not C",
              "equals": "AGT"
            }, {
              "symbol": "B",
              "name": "Not A",
              "equals": "CGT"
            }, {
              "symbol": "M",
              "name": "Amino",
              "equals": "AC"
            }, {
              "symbol": "R",
              "name": "Purine",
              "equals": "AG"
            }, {
              "symbol": "W",
              "name": "Weak",
              "equals": "AT"
            }, {
              "symbol": "S",
              "name": "Strong",
              "equals": "CG"
            }, {
              "symbol": "Y",
              "name": "Pyrimidine",
              "equals": "CT"
            }, {
              "symbol": "K",
              "name": "Keto",
              "equals": "GT"
            }
          ]
        },
        "background": [0.277, 0.223, 0.223, 0.277],
        "query_dbs": [
          {
            "source": "meme/meme-chip_TCP7_1/meme_out/meme.html",
            "name": "meme.html",
            "loaded": 5,
            "excluded": 0,
            "last_modified": "Thu Mar 31 19:27:47 2022"
          }
        ],
        "target_dbs": [
          {
            "source": "/diska/database/jaspar/JASPAR2020_CORE_non-redundant_pfms_meme.txt",
            "name": "JASPAR2020_CORE_non-redundant_pfms_meme.txt",
            "loaded": 1646,
            "excluded": 0,
            "last_modified": "Sat May 30 02:18:37 2020"
          }
        ],
        "queries": [
          {
            "db": 0,
            "id": "CCCACCCCGAATTTC",
            "alt": "MEME-2",
            "len": 15,
            "nsites": 869,
            "evalue": "6.7e-1223",
            "pwm": [
              [0.0103877, 0.90556, 0.0690627, 0.0149902], 
              [3.1872e-05, 0.963091, 0.00232639, 0.0345499], 
              [3.1872e-05, 0.883698, 2.56587e-05, 0.116244], 
              [0.973453, 2.56587e-05, 0.0264896, 3.1872e-05], 
              [0.00693508, 0.933175, 2.56587e-05, 0.059864], 
              [0.00233261, 0.974598, 2.56587e-05, 0.0230442], 
              [0.00233261, 0.948133, 2.56587e-05, 0.0495082], 
              [0.00923681, 0.909012, 2.56587e-05, 0.0817255], 
              [0.188733, 0.00232639, 0.808909, 3.1872e-05], 
              [0.87565, 2.56587e-05, 0.124292, 3.1872e-05], 
              [0.996465, 2.56587e-05, 2.56587e-05, 0.00348347], 
              [0.00693508, 0.0656111, 2.56587e-05, 0.927428], 
              [3.1872e-05, 2.56587e-05, 2.56587e-05, 0.999917], 
              [3.1872e-05, 2.56587e-05, 2.56587e-05, 0.999917], 
              [3.1872e-05, 0.929723, 2.56587e-05, 0.0702198]
            ]
          }, {
            "db": 0,
            "id": "CTGAAACCCGRAGTAA",
            "alt": "MEME-4",
            "len": 16,
            "nsites": 919,
            "evalue": "2.4e-1350",
            "pwm": [
              [0.019615, 0.763815, 0.00764043, 0.20893], 
              [0.00873419, 2.42629e-05, 0.00328791, 0.987953], 
              [0.0870717, 0.00546467, 0.907434, 3.01382e-05], 
              [0.996658, 2.42629e-05, 0.00328791, 3.01382e-05], 
              [0.999921, 2.42629e-05, 2.42629e-05, 3.01382e-05], 
              [0.994481, 0.00111214, 0.00111214, 0.00329378], 
              [0.00111802, 0.8378, 2.42629e-05, 0.161058], 
              [0.00547055, 0.938986, 2.42629e-05, 0.0555191], 
              [0.0163504, 0.901993, 0.00328791, 0.0783676], 
              [0.23613, 0.00328791, 0.760551, 3.01382e-05], 
              [0.455911, 2.42629e-05, 0.544035, 3.01382e-05], 
              [0.826926, 0.00111214, 0.171932, 3.01382e-05], 
              [0.143649, 2.42629e-05, 0.856297, 3.01382e-05], 
              [3.01382e-05, 0.00546467, 2.42629e-05, 0.994481], 
              [0.992305, 2.42629e-05, 0.00764043, 3.01382e-05], 
              [0.994481, 2.42629e-05, 0.00220003, 0.00329378]
            ]
          }, {
            "db": 0,
            "id": "TGSRRGTGGGCCCCRC",
            "alt": "MEME-1",
            "len": 16,
            "nsites": 2826,
            "evalue": "6.0e-3027",
            "pwm": [
              [0.106517, 0.0821, 0.262915, 0.548468], 
              [0.187901, 0.0750232, 0.556959, 0.180116], 
              [0.159947, 0.258668, 0.457883, 0.123501], 
              [0.555899, 0.0704234, 0.278483, 0.0951944], 
              [0.294054, 0.0594538, 0.492559, 0.153932], 
              [0.0753791, 0.0332697, 0.870111, 0.0212401], 
              [9.80149e-06, 0.0304388, 0.0187612, 0.95079], 
              [0.00991745, 7.89074e-06, 0.990065, 9.80149e-06], 
              [9.80149e-06, 7.89074e-06, 0.999973, 9.80149e-06], 
              [0.132348, 0.00354677, 0.616405, 0.247701], 
              [0.0824559, 0.672666, 0.0594538, 0.185424], 
              [9.80149e-06, 0.993957, 7.89074e-06, 0.00602559], 
              [9.80149e-06, 0.999973, 7.89074e-06, 9.80149e-06], 
              [9.80149e-06, 0.981572, 7.89074e-06, 0.0184102], 
              [0.516623, 0.0212381, 0.429222, 0.0329176], 
              [0.0180562, 0.886389, 0.026192, 0.0693633]
            ]
          }, {
            "db": 0,
            "id": "TTTTCGGTAAATTTT",
            "alt": "MEME-3",
            "len": 15,
            "nsites": 949,
            "evalue": "3.1e-1194",
            "pwm": [
              [0.135948, 0.0105594, 2.3496e-05, 0.853469], 
              [2.91855e-05, 2.3496e-05, 0.00423805, 0.995709], 
              [2.91855e-05, 0.0105594, 2.3496e-05, 0.989388], 
              [0.0168874, 2.3496e-05, 0.00318416, 0.979905], 
              [0.0179413, 0.791299, 0.00423805, 0.186522], 
              [0.285563, 2.3496e-05, 0.699634, 0.0147796], 
              [0.040067, 2.3496e-05, 0.95988, 2.91855e-05], 
              [2.91855e-05, 2.3496e-05, 0.00529194, 0.994655], 
              [0.947242, 0.00318416, 0.0358467, 0.0137267], 
              [0.860844, 2.3496e-05, 0.102226, 0.0369063], 
              [0.930384, 2.3496e-05, 2.3496e-05, 0.0695689], 
              [0.233935, 0.107494, 2.3496e-05, 0.658548], 
              [2.91855e-05, 0.0137211, 2.3496e-05, 0.986226], 
              [0.00108307, 0.121191, 2.3496e-05, 0.877703], 
              [0.00635052, 0.00529194, 2.3496e-05, 0.988334]
            ]
          }, {
            "db": 0,
            "id": "TYGGCATAACCTCCCT",
            "alt": "MEME-5",
            "len": 16,
            "nsites": 678,
            "evalue": "2.0e-818",
            "pwm": [
              [0.00151563, 3.2886e-05, 3.2886e-05, 0.998419], 
              [0.00151563, 0.570745, 0.00445723, 0.423282], 
              [0.179955, 0.00150767, 0.809648, 0.00888954], 
              [0.277286, 3.2886e-05, 0.719691, 0.00299041], 
              [0.00888954, 0.706419, 0.160776, 0.123917], 
              [0.980722, 0.00888158, 0.0074068, 0.00299041], 
              [0.255165, 3.2886e-05, 0.0074068, 0.737395], 
              [0.991045, 3.2886e-05, 0.00888158, 4.08494e-05], 
              [0.993994, 3.2886e-05, 0.00298245, 0.00299041], 
              [0.0044652, 0.696095, 3.2886e-05, 0.299407], 
              [0.00593998, 0.945321, 3.2886e-05, 0.0487067], 
              [0.0044652, 0.00445723, 0.00150767, 0.989571], 
              [0.0782003, 0.784578, 3.2886e-05, 0.137189], 
              [0.00593998, 0.906979, 3.2886e-05, 0.087049], 
              [0.019212, 0.884858, 0.00445723, 0.0914724], 
              [0.0103633, 0.0354257, 3.2886e-05, 0.954177]
            ]
          }
        ],
        "targets": [
          {
            "db": 0,
            "id": "MA0028.2",
            "alt": "ELK1",
            "len": 10,
            "nsites": 67234,
            "url": "http://jaspar.genereg.net/matrix/MA0028.2",
            "pwm": [
              [0.681306, 0.0409023, 0.192745, 0.0850463], 
              [0.0249704, 0.939861, 0.0303253, 0.0048424], 
              [0.0077634, 0.990506, 0.00127633, 0.000454411], 
              [4.11993e-07, 0.000458331, 0.998974, 0.000567411], 
              [8.64119e-05, 0.00088033, 0.983721, 0.0153124], 
              [0.993062, 0.00505132, 0.00134433, 0.000542411], 
              [0.94711, 0.00688532, 0.00124133, 0.0447643], 
              [0.0585883, 0.0458643, 0.889835, 0.0057114], 
              [0.0169144, 0.116499, 0.0207373, 0.845849], 
              [0.289781, 0.145676, 0.377082, 0.18746]
            ]
          }, {
            "db": 0,
            "id": "MA0039.4",
            "alt": "KLF4",
            "len": 12,
            "nsites": 55817,
            "url": "http://jaspar.genereg.net/matrix/MA0039.4",
            "pwm": [
              [0.2252, 0.313883, 0.255173, 0.205744], 
              [0.205798, 0.2515, 0.330957, 0.211746], 
              [0.0441624, 0.881612, 0.0283613, 0.0458644], 
              [0.0377134, 0.857533, 0.0217504, 0.0830033], 
              [0.125786, 0.813461, 0.0254764, 0.0352764], 
              [0.0210155, 0.947291, 0.0142074, 0.0174865], 
              [0.81699, 0.00288439, 0.118208, 0.0619174], 
              [0.0152645, 0.938172, 0.0263364, 0.0202275], 
              [0.0289704, 0.915706, 0.0335023, 0.0218215], 
              [0.0215355, 0.914505, 0.0180054, 0.0459544], 
              [0.291381, 0.326943, 0.112726, 0.26895], 
              [0.178422, 0.344286, 0.25838, 0.218912]
            ]
          }, {
            "db": 0,
            "id": "MA0103.3",
            "alt": "ZEB1",
            "len": 11,
            "nsites": 20129,
            "url": "http://jaspar.genereg.net/matrix/MA0103.3",
            "pwm": [
              [0.159522, 0.397336, 0.259725, 0.183417], 
              [0.232749, 0.275722, 0.25729, 0.234239], 
              [0.00566435, 0.953595, 0.00785007, 0.0328892], 
              [0.988868, 1.10785e-06, 0.0110801, 5.13759e-05], 
              [0.00159137, 0.987526, 0.00482008, 0.00606235], 
              [0.00958933, 0.956675, 0.0322429, 0.00149137], 
              [0.000200375, 0.02489, 0.017637, 0.957273], 
              [0.0219103, 0.00884406, 0.962836, 0.00641034], 
              [0.0984659, 0.474985, 0.257241, 0.169309], 
              [0.211536, 0.30389, 0.327934, 0.156641], 
              [0.173383, 0.34552, 0.289533, 0.191564]
            ]
          }, {
            "db": 0,
            "id": "MA0123.1",
            "alt": "abi4",
            "len": 10,
            "nsites": 49,
            "url": "http://jaspar.genereg.net/matrix/MA0123.1",
            "pwm": [
              [0.000564154, 0.998418, 0.000454175, 0.000564154], 
              [0.244963, 0.000454175, 0.754018, 0.000564154], 
              [0.000564154, 0.407786, 0.591086, 0.000564154], 
              [0.000564154, 0.468886, 0.0208206, 0.509729], 
              [0.0209306, 0.0615535, 0.916951, 0.000564154], 
              [0.000564154, 0.916951, 0.0819209, 0.000564154], 
              [0.102397, 0.570719, 0.122654, 0.204231], 
              [0.0616635, 0.509619, 0.224487, 0.204231], 
              [0.0616635, 0.631819, 0.102287, 0.204231], 
              [0.0820309, 0.529985, 0.14302, 0.244963]
            ]
          }, {
            "db": 0,
            "id": "MA0156.2",
            "alt": "FEV",
            "len": 10,
            "nsites": 11007,
            "url": "http://jaspar.genereg.net/matrix/MA0156.2",
            "pwm": [
              [0.658578, 0.0521506, 0.141275, 0.147998], 
              [0.124268, 0.773222, 0.0765883, 0.0259223], 
              [0.0775568, 0.915619, 0.00644397, 0.000381513], 
              [0.0017925, 2.02597e-06, 0.997928, 0.000277514], 
              [0.000277514, 0.000140025, 0.99834, 0.00124151], 
              [0.995598, 0.00151301, 0.000414022, 0.00247449], 
              [0.754707, 0.0160349, 0.00062702, 0.228631], 
              [0.300952, 0.0331987, 0.657502, 0.00834744], 
              [0.0437981, 0.179621, 0.0615525, 0.715029], 
              [0.294426, 0.187362, 0.311395, 0.206817]
            ]
          }, {
            "db": 0,
            "id": "MA0213.1",
            "alt": "brk",
            "len": 8,
            "nsites": 10,
            "url": "http://jaspar.genereg.net/matrix/MA0213.1",
            "pwm": [
              [0.101752, 0.497257, 0.398248, 0.00274257], 
              [0.00274257, 0.398248, 0.00220792, 0.596802], 
              [0.00274257, 0.00220792, 0.992307, 0.00274257], 
              [0.00274257, 0.00220792, 0.992307, 0.00274257], 
              [0.00274257, 0.992307, 0.00220792, 0.00274257], 
              [0.101752, 0.00220792, 0.893297, 0.00274257], 
              [0.101752, 0.794287, 0.00220792, 0.101752], 
              [0.00274257, 0.497257, 0.101218, 0.398782]
            ]
          }, {
            "db": 0,
            "id": "MA0260.1",
            "alt": "che-1",
            "len": 6,
            "nsites": 37,
            "url": "http://jaspar.genereg.net/matrix/MA0260.1",
            "pwm": [
              [0.00074663, 0.000601079, 0.997906, 0.00074663], 
              [0.998051, 0.000601079, 0.000601079, 0.00074663], 
              [0.998051, 0.000601079, 0.000601079, 0.00074663], 
              [0.512876, 0.000601079, 0.485776, 0.00074663], 
              [0.00074663, 0.997906, 0.000601079, 0.00074663], 
              [0.00074663, 0.70141, 0.297097, 0.00074663]
            ]
          }, {
            "db": 0,
            "id": "MA0338.1",
            "alt": "MIG2",
            "len": 7,
            "nsites": 100,
            "url": "http://jaspar.genereg.net/matrix/MA0338.1",
            "pwm": [
              [0.0102667, 0.959264, 0.0202028, 0.0102667], 
              [0.000276723, 0.999224, 0.000222777, 0.000276723], 
              [0.000276723, 0.999224, 0.000222777, 0.000276723], 
              [0.000276723, 0.999224, 0.000222777, 0.000276723], 
              [0.359917, 0.110113, 0.519703, 0.0102667], 
              [0.0497323, 0.761837, 0.128807, 0.0596234], 
              [0.363549, 0.242405, 0.242405, 0.15164]
            ]
          }, {
            "db": 0,
            "id": "MA0339.1",
            "alt": "MIG3",
            "len": 7,
            "nsites": 101,
            "url": "http://jaspar.genereg.net/matrix/MA0339.1",
            "pwm": [
              [0.0101652, 0.969558, 0.0101118, 0.0101652], 
              [0.000273986, 0.939291, 0.000220574, 0.0602146], 
              [0.000273986, 0.999231, 0.000220574, 0.000273986], 
              [0.000273986, 0.999231, 0.000220574, 0.000273986], 
              [0.414005, 0.0204026, 0.555227, 0.010365], 
              [0.0502245, 0.689538, 0.170052, 0.090185], 
              [0.409868, 0.220003, 0.229993, 0.140136]
            ]
          }, {
            "db": 0,
            "id": "MA0399.1",
            "alt": "SUT1",
            "len": 7,
            "nsites": 230,
            "url": "http://jaspar.genereg.net/matrix/MA0399.1",
            "pwm": [
              [0.100077, 0.61722, 0.156551, 0.126153], 
              [0.201714, 0.0210958, 0.77707, 0.000120382], 
              [0.000120382, 0.999662, 9.69145e-05, 0.000120382], 
              [0.0311149, 0.236428, 0.728462, 0.0039947], 
              [0.000120382, 0.169141, 0.830618, 0.000120382], 
              [0.208541, 0.148968, 0.642371, 0.000120382], 
              [0.189693, 0.0604157, 0.732537, 0.0173539]
            ]
          }, {
            "db": 0,
            "id": "MA0436.1",
            "alt": "YPR022C",
            "len": 7,
            "nsites": 101,
            "url": "http://jaspar.genereg.net/matrix/MA0436.1",
            "pwm": [
              [0.148642, 0.653039, 0.000220574, 0.198098], 
              [0.000273986, 0.999231, 0.000220574, 0.000273986], 
              [0.000273986, 0.999231, 0.000220574, 0.000273986], 
              [0.000273986, 0.999231, 0.000220574, 0.000273986], 
              [0.999285, 0.000220574, 0.000220574, 0.000273986], 
              [0.000273986, 0.999231, 0.000220574, 0.000273986], 
              [0.227772, 0.257392, 0.336522, 0.178316]
            ]
          }, {
            "db": 0,
            "id": "MA0493.1",
            "alt": "Klf1",
            "len": 11,
            "nsites": 526,
            "url": "http://jaspar.genereg.net/matrix/MA0493.1",
            "pwm": [
              [0.285169, 0.144502, 0.383999, 0.186329], 
              [0.317482, 0.0760739, 0.57978, 0.0266636], 
              [0.127404, 0.752751, 0.0608678, 0.0589764], 
              [0.024763, 0.876302, 4.23874e-05, 0.0988929], 
              [0.767968, 0.224335, 4.23874e-05, 0.00765621], 
              [5.26516e-05, 0.999852, 4.23874e-05, 5.26516e-05], 
              [0.760364, 4.23874e-05, 0.184418, 0.0551752], 
              [5.26516e-05, 0.999852, 4.23874e-05, 5.26516e-05], 
              [5.26516e-05, 0.999852, 4.23874e-05, 5.26516e-05], 
              [5.26516e-05, 0.965638, 4.23874e-05, 0.0342671], 
              [0.53227, 0.0665697, 4.23874e-05, 0.401117]
            ]
          }, {
            "db": 0,
            "id": "MA0516.2",
            "alt": "SP2",
            "len": 17,
            "nsites": 793,
            "url": "http://jaspar.genereg.net/matrix/MA0516.2",
            "pwm": [
              [0.322819, 0.388377, 0.155116, 0.133688], 
              [0.0596454, 0.192355, 0.064137, 0.683864], 
              [0.705355, 0.0874741, 2.81175e-05, 0.207144], 
              [0.803563, 0.0896648, 0.0352427, 0.0715309], 
              [0.0532302, 0.125135, 0.77924, 0.0423946], 
              [0.0412417, 0.552685, 0.00972389, 0.396349], 
              [0.0177767, 0.980893, 0.00129496, 3.49262e-05], 
              [0.0194735, 0.954951, 0.0158221, 0.0097547], 
              [0.00487732, 0.953903, 0.0266588, 0.0145611], 
              [0.0855301, 0.0542443, 0.813273, 0.046953], 
              [3.49262e-05, 0.977765, 2.81175e-05, 0.0221721], 
              [0.00605117, 0.95418, 0.0313122, 0.00845786], 
              [0.0279444, 0.93923, 2.81175e-05, 0.0327978], 
              [0.483729, 0.469283, 0.0264988, 0.0204893], 
              [0.0274285, 0.845501, 0.00127296, 0.125797], 
              [0.13087, 0.265301, 2.81175e-05, 0.603801], 
              [0.189166, 0.255986, 0.110985, 0.443863]
            ]
          }, {
            "db": 0,
            "id": "MA0587.1",
            "alt": "TCP16",
            "len": 10,
            "nsites": 64,
            "url": "http://jaspar.genereg.net/matrix/MA0587.1",
            "pwm": [
              [0.047234, 0.000347894, 0.936385, 0.0160328], 
              [0.0160328, 0.0471498, 0.000347894, 0.93647], 
              [0.000432137, 0.000347894, 0.998788, 0.000432137], 
              [0.000432137, 0.000347894, 0.998788, 0.000432137], 
              [0.499652, 0.125153, 0.234357, 0.140838], 
              [0.0160328, 0.936385, 0.0315491, 0.0160328], 
              [0.000432137, 0.998788, 0.000347894, 0.000432137], 
              [0.000432137, 0.998788, 0.000347894, 0.000432137], 
              [0.281243, 0.156354, 0.452766, 0.109637], 
              [0.18764, 0.31236, 0.405964, 0.0940359]
            ]
          }, {
            "db": 0,
            "id": "MA0598.3",
            "alt": "EHF",
            "len": 15,
            "nsites": 15368,
            "url": "http://jaspar.genereg.net/matrix/MA0598.3",
            "pwm": [
              [0.212129, 0.28247, 0.266918, 0.238483], 
              [0.175821, 0.301144, 0.218311, 0.304724], 
              [0.13756, 0.578278, 0.100209, 0.183955], 
              [0.872849, 0.0296733, 0.0504301, 0.0470475], 
              [0.0109987, 0.853458, 0.0245323, 0.111011], 
              [0.0277866, 0.0108684, 0.00989239, 0.951454], 
              [0.00911174, 0.0106734, 0.0129504, 0.967266], 
              [0.0126907, 0.965182, 0.00904639, 0.0130807], 
              [0.0102827, 0.975854, 0.00657341, 0.00728976], 
              [0.0278516, 0.0395642, 0.100079, 0.832505], 
              [0.0452255, 0.194105, 0.5896, 0.171071], 
              [0.150639, 0.197098, 0.214667, 0.437597], 
              [0.146214, 0.114655, 0.0822499, 0.656882], 
              [0.209266, 0.238873, 0.200937, 0.350924], 
              [0.200612, 0.314223, 0.207834, 0.27733]
            ]
          }, {
            "db": 0,
            "id": "MA0599.1",
            "alt": "KLF5",
            "len": 10,
            "nsites": 13611,
            "url": "http://jaspar.genereg.net/matrix/MA0599.1",
            "pwm": [
              [0.10499, 0.148631, 0.556313, 0.190068], 
              [2.0351e-06, 0.874288, 1.63837e-06, 0.125708], 
              [2.0351e-06, 0.882223, 1.63837e-06, 0.117773], 
              [0.255455, 0.70303, 1.63837e-06, 0.0415127], 
              [2.0351e-06, 0.999994, 1.63837e-06, 2.0351e-06], 
              [0.371096, 1.63837e-06, 0.38072, 0.248182], 
              [2.0351e-06, 0.999994, 1.63837e-06, 2.0351e-06], 
              [2.0351e-06, 0.999994, 1.63837e-06, 2.0351e-06], 
              [2.0351e-06, 0.965023, 1.63837e-06, 0.0349738], 
              [0.287635, 0.411064, 1.63837e-06, 0.3013]
            ]
          }, {
            "db": 0,
            "id": "MA0641.1",
            "alt": "ELF4",
            "len": 12,
            "nsites": 1059,
            "url": "http://jaspar.genereg.net/matrix/MA0641.1",
            "pwm": [
              [0.564657, 0.102938, 0.151093, 0.181312], 
              [0.748363, 0.0775087, 0.0159436, 0.158185], 
              [0.151273, 0.71042, 0.0573116, 0.0809965], 
              [0.0152987, 0.889425, 0.0943521, 0.000924069], 
              [0.0511093, 0.943168, 0.00569652, 2.61543e-05], 
              [0.000841077, 2.10556e-05, 0.999112, 2.61543e-05], 
              [2.61543e-05, 2.10556e-05, 0.998298, 0.001655], 
              [0.994548, 2.10556e-05, 0.0027128, 0.0027179], 
              [0.985227, 0.00670442, 0.0026948, 0.00537365], 
              [0.033775, 0.0141487, 0.947342, 0.00473571], 
              [0.0037748, 0.0525001, 0.0262606, 0.917466], 
              [0.379463, 0.0781677, 0.43595, 0.106419]
            ]
          }, {
            "db": 0,
            "id": "MA0652.1",
            "alt": "IRF8",
            "len": 14,
            "nsites": 5878,
            "url": "http://jaspar.genereg.net/matrix/MA0652.1",
            "pwm": [
              [0.222696, 0.339569, 0.0971441, 0.340591], 
              [0.00920956, 0.858843, 0.00277975, 0.129167], 
              [0.000514704, 3.79375e-06, 0.999137, 0.000344707], 
              [0.999648, 0.000343788, 3.79375e-06, 4.7124e-06], 
              [0.994405, 3.79375e-06, 3.79375e-06, 0.00558762], 
              [0.999478, 3.79375e-06, 3.79375e-06, 0.000514704], 
              [0.00828957, 0.901798, 0.0889863, 0.000925697], 
              [0.000848698, 0.82648, 3.79375e-06, 0.172668], 
              [4.7124e-06, 3.79375e-06, 0.999987, 4.7124e-06], 
              [0.999478, 3.79375e-06, 0.000513785, 4.7124e-06], 
              [0.988219, 3.79375e-06, 0.000339788, 0.0114365], 
              [0.999138, 0.000853779, 3.79375e-06, 4.7124e-06], 
              [0.00158369, 0.843923, 0.152334, 0.00215868], 
              [0.041905, 0.189793, 0.00104778, 0.767255]
            ]
          }, {
            "db": 0,
            "id": "MA0738.1",
            "alt": "HIC2",
            "len": 9,
            "nsites": 5652,
            "url": "http://jaspar.genereg.net/matrix/MA0738.1",
            "pwm": [
              [0.461073, 0.0697127, 0.404279, 0.0649368], 
              [4.90083e-06, 0.0233665, 3.94544e-06, 0.976625], 
              [0.0838744, 0.0601049, 0.830379, 0.0256414], 
              [0.00467182, 0.992478, 0.0028449, 4.90083e-06], 
              [0.0807835, 0.908252, 3.94544e-06, 0.0109607], 
              [0.299734, 0.700258, 3.94544e-06, 4.90083e-06], 
              [0.509604, 0.145136, 0.263695, 0.0815655], 
              [0.157434, 0.449802, 0.252913, 0.139851], 
              [0.155389, 0.354118, 0.204662, 0.285831]
            ]
          }, {
            "db": 0,
            "id": "MA0739.1",
            "alt": "Hic1",
            "len": 9,
            "nsites": 12392,
            "url": "http://jaspar.genereg.net/matrix/MA0739.1",
            "pwm": [
              [0.511376, 0.0580223, 0.376855, 0.0537458], 
              [0.00536319, 0.0364945, 0.00631475, 0.951828], 
              [0.0746406, 0.0461984, 0.864781, 0.0143801], 
              [0.0044752, 0.984696, 0.0108267, 2.23529e-06], 
              [0.00786317, 0.983289, 0.00277078, 0.00607719], 
              [0.795264, 0.176481, 0.000266797, 0.027988], 
              [0.557825, 0.180431, 0.20596, 0.0557848], 
              [0.0795116, 0.717345, 0.106166, 0.0969775], 
              [0.146258, 0.438043, 0.171148, 0.244549]
            ]
          }, {
            "db": 0,
            "id": "MA0740.1",
            "alt": "KLF14",
            "len": 14,
            "nsites": 2304,
            "url": "http://jaspar.genereg.net/matrix/MA0740.1",
            "pwm": [
              [0.186636, 0.0933216, 0.419262, 0.30078], 
              [0.332045, 0.0201248, 0.628254, 0.0195762], 
              [0.220455, 0.569977, 0.0402429, 0.169326], 
              [1.2022e-05, 0.861038, 0.00539444, 0.133555], 
              [0.895621, 0.0713226, 0.0304224, 0.00263391], 
              [0.00126197, 0.997466, 9.67841e-06, 0.00126197], 
              [0.02245, 0.0117162, 0.95574, 0.0100926], 
              [1.2022e-05, 0.998097, 0.0018786, 1.2022e-05], 
              [1.2022e-05, 0.994387, 0.0018696, 0.00373186], 
              [1.2022e-05, 0.958848, 0.00239357, 0.0387473], 
              [0.418952, 0.562302, 0.000594653, 0.0181502], 
              [0.0154774, 0.707084, 0.00725936, 0.270179], 
              [0.139727, 0.296404, 0.0444188, 0.51945], 
              [0.192357, 0.219621, 0.0930706, 0.494952]
            ]
          }, {
            "db": 0,
            "id": "MA0746.2",
            "alt": "SP3",
            "len": 13,
            "nsites": 6591,
            "url": "http://jaspar.genereg.net/matrix/MA0746.2",
            "pwm": [
              [0.192233, 0.285843, 0.287512, 0.234412], 
              [0.284502, 0.0703983, 0.589282, 0.0558164], 
              [0.0848479, 0.842184, 0.0288809, 0.0440875], 
              [0.0228379, 0.94062, 0.00771027, 0.0288318], 
              [0.795419, 0.202604, 0.000306379, 0.00167018], 
              [0.000912189, 0.997264, 3.38335e-06, 0.00182018], 
              [0.0615113, 3.38335e-06, 0.871815, 0.0666702], 
              [4.20263e-06, 0.999988, 3.38335e-06, 4.20263e-06], 
              [4.20263e-06, 0.998624, 3.38335e-06, 0.00136818], 
              [0.000277198, 0.901262, 0.000276379, 0.0981837], 
              [0.477646, 0.440047, 0.0054343, 0.076873], 
              [0.0746941, 0.687258, 0.0399008, 0.198147], 
              [0.230012, 0.395688, 0.0795042, 0.294796]
            ]
          }, {
            "db": 0,
            "id": "MA0759.1",
            "alt": "ELK3",
            "len": 10,
            "nsites": 3700,
            "url": "http://jaspar.genereg.net/matrix/MA0759.1",
            "pwm": [
              [0.604586, 0.0794629, 0.192704, 0.123247], 
              [0.0958709, 0.797204, 0.0794769, 0.0274477], 
              [0.0504471, 0.940292, 0.00589087, 0.0033704], 
              [0.000454474, 6.02687e-06, 0.999532, 7.48628e-06], 
              [0.000869463, 0.00172898, 0.963789, 0.0336126], 
              [0.995088, 0.00311994, 0.00134099, 0.000452474], 
              [0.849586, 0.0163366, 6.02687e-06, 0.134072], 
              [0.163927, 0.0806488, 0.736326, 0.019099], 
              [0.0496281, 0.160041, 0.0552135, 0.735118], 
              [0.347785, 0.142157, 0.290119, 0.219939]
            ]
          }, {
            "db": 0,
            "id": "MA0760.1",
            "alt": "ERF",
            "len": 10,
            "nsites": 245,
            "url": "http://jaspar.genereg.net/matrix/MA0760.1",
            "pwm": [
              [0.836507, 0.0164113, 0.13473, 0.012353], 
              [0.0276608, 0.806849, 0.0315741, 0.133916], 
              [0.106002, 0.868381, 0.0255046, 0.000113015], 
              [0.000113015, 9.09833e-05, 0.999683, 0.000113015], 
              [0.000113015, 0.0145081, 0.985266, 0.000113015], 
              [0.962161, 0.0141702, 0.0141702, 0.00949918], 
              [0.872097, 9.09833e-05, 9.09833e-05, 0.127721], 
              [0.26974, 0.0559892, 0.674158, 0.000113015], 
              [0.000113015, 0.159559, 0.0428755, 0.797453], 
              [0.303911, 0.13729, 0.450887, 0.107912]
            ]
          }, {
            "db": 0,
            "id": "MA0762.1",
            "alt": "ETV2",
            "len": 11,
            "nsites": 2202,
            "url": "http://jaspar.genereg.net/matrix/MA0762.1",
            "pwm": [
              [0.537681, 0.113992, 0.180747, 0.16758], 
              [0.968872, 0.00819276, 0.0188313, 0.00410439], 
              [0.0422327, 0.877007, 0.0807475, 1.25789e-05], 
              [0.0890335, 0.908641, 0.00231202, 1.25789e-05], 
              [1.25789e-05, 1.01267e-05, 0.999965, 1.25789e-05], 
              [1.25789e-05, 1.01267e-05, 0.999965, 1.25789e-05], 
              [0.999967, 1.01267e-05, 1.01267e-05, 1.25789e-05], 
              [0.891538, 0.000763093, 1.01267e-05, 0.107689], 
              [0.713904, 0.00169805, 0.284385, 1.25789e-05], 
              [0.0105511, 0.257609, 0.0386504, 0.693189], 
              [0.471102, 0.102227, 0.279997, 0.146673]
            ]
          }, {
            "db": 0,
            "id": "MA0961.1",
            "alt": "BHLH112",
            "len": 9,
            "nsites": 999,
            "url": "http://jaspar.genereg.net/matrix/MA0961.1",
            "pwm": [
              [0.221227, 0.250247, 0.306298, 0.222227], 
              [2.77249e-05, 0.999922, 2.23201e-05, 2.77249e-05], 
              [0.17701, 0.82294, 2.23201e-05, 2.77249e-05], 
              [0.999928, 2.23201e-05, 2.23201e-05, 2.77249e-05], 
              [2.77249e-05, 0.999922, 2.23201e-05, 2.77249e-05], 
              [2.77249e-05, 2.23201e-05, 2.23201e-05, 0.999928], 
              [2.77249e-05, 2.23201e-05, 2.23201e-05, 0.999928], 
              [2.77249e-05, 2.23201e-05, 0.999922, 2.77249e-05], 
              [0.217788, 0.342645, 0.216784, 0.222782]
            ]
          }, {
            "db": 0,
            "id": "MA1019.1",
            "alt": "Glyma19g26560.1",
            "len": 9,
            "nsites": 1001,
            "url": "http://jaspar.genereg.net/matrix/MA1019.1",
            "pwm": [
              [0.103913, 0.198803, 0.479494, 0.217788], 
              [0.0190258, 0.0140209, 0.907932, 0.0590218], 
              [0.0861051, 0.0190394, 0.861798, 0.0330574], 
              [0.109017, 0.306992, 0.439978, 0.144013], 
              [0.0420235, 0.881934, 0.0270196, 0.0490228], 
              [0.00302737, 0.995923, 0.00102218, 2.76695e-05], 
              [0.00402727, 0.975925, 2.22755e-05, 0.0200257], 
              [0.895938, 0.0170206, 0.0760147, 0.0110266], 
              [0.017026, 0.843938, 0.0500173, 0.0890188]
            ]
          }, {
            "db": 0,
            "id": "MA1031.1",
            "alt": "OJ1581_H09.2",
            "len": 10,
            "nsites": 999,
            "url": "http://jaspar.genereg.net/matrix/MA1031.1",
            "pwm": [
              [0.175185, 0.13114, 0.414395, 0.279279], 
              [0.0740203, 0.146008, 0.334989, 0.444983], 
              [2.77249e-05, 2.23201e-05, 0.928929, 0.0710206], 
              [2.77249e-05, 2.23201e-05, 0.999922, 2.77249e-05], 
              [0.126888, 0.100911, 0.660296, 0.111905], 
              [0.111905, 0.660296, 0.100911, 0.126888], 
              [2.77249e-05, 0.999922, 2.23201e-05, 2.77249e-05], 
              [0.0710206, 0.928929, 2.23201e-05, 2.77249e-05], 
              [0.444983, 0.334989, 0.146008, 0.0740203], 
              [0.279279, 0.414395, 0.13114, 0.175185]
            ]
          }, {
            "db": 0,
            "id": "MA1035.1",
            "alt": "TCP4",
            "len": 8,
            "nsites": 1000,
            "url": "http://jaspar.genereg.net/matrix/MA1035.1",
            "pwm": [
              [0.112016, 0.0010222, 0.774945, 0.112016], 
              [0.0010266, 0.0010212, 0.996926, 0.0010266], 
              [0.0010266, 0.0010212, 0.996926, 0.0010266], 
              [0.830945, 0.167006, 0.0010222, 0.0010276], 
              [0.0010266, 0.996926, 0.0010212, 0.0010266], 
              [0.0010266, 0.996926, 0.0010212, 0.0010266], 
              [0.996928, 0.0010222, 0.0010222, 0.0010276], 
              [0.0010286, 0.99692, 0.0010232, 0.0010286]
            ]
          }, {
            "db": 0,
            "id": "MA1050.1",
            "alt": "OsI_08196",
            "len": 8,
            "nsites": 1001,
            "url": "http://jaspar.genereg.net/matrix/MA1050.1",
            "pwm": [
              [0.00102657, 0.00102118, 0.944983, 0.0529694], 
              [0.0460691, 2.22755e-05, 0.953881, 2.76695e-05], 
              [0.0911096, 0.0911042, 0.726677, 0.0911096], 
              [2.76695e-05, 0.862936, 0.0460177, 0.0910186], 
              [2.76695e-05, 0.999922, 2.22755e-05, 2.76695e-05], 
              [2.76695e-05, 0.999922, 2.22755e-05, 2.76695e-05], 
              [0.899838, 0.0500673, 0.0500673, 2.76695e-05], 
              [0.00102757, 0.854937, 0.0720151, 0.0720205]
            ]
          }, {
            "db": 0,
            "id": "MA1054.1",
            "alt": "ARALYDRAFT_897773",
            "len": 10,
            "nsites": 1000,
            "url": "http://jaspar.genereg.net/matrix/MA1054.1",
            "pwm": [
              [0.0920185, 0.277995, 0.167006, 0.462981], 
              [0.027052, 0.0790934, 0.491464, 0.402389], 
              [0.0360241, 0.0040219, 0.876935, 0.0830194], 
              [0.017026, 0.0070216, 0.956927, 0.0190258], 
              [0.0400237, 0.12501, 0.82594, 0.0090268], 
              [0.755952, 0.215001, 0.0070216, 0.0220255], 
              [0.0020275, 0.948927, 0.0470176, 0.0020275], 
              [0.0010286, 0.995919, 0.0020241, 0.0010286], 
              [0.861942, 0.0020221, 0.132009, 0.0040273], 
              [0.0200257, 0.906932, 0.0060217, 0.067021]
            ]
          }, {
            "db": 0,
            "id": "MA1061.1",
            "alt": "SPT",
            "len": 9,
            "nsites": 1000,
            "url": "http://jaspar.genereg.net/matrix/MA1061.1",
            "pwm": [
              [0.202007, 0.42698, 0.208001, 0.163011], 
              [0.04707, 0.568534, 0.255252, 0.129144], 
              [2.76972e-05, 0.960926, 2.22978e-05, 0.0390238], 
              [0.884939, 2.22978e-05, 0.0990124, 0.0160261], 
              [0.0090358, 0.910842, 2.22978e-05, 0.0800997], 
              [0.0880189, 2.22978e-05, 0.911931, 2.76972e-05], 
              [2.76972e-05, 0.0120211, 2.22978e-05, 0.987929], 
              [0.0841033, 0.115126, 0.724675, 0.0760961], 
              [0.220785, 0.300691, 0.236762, 0.241762]
            ]
          }, {
            "db": 0,
            "id": "MA1062.2",
            "alt": "TCP15",
            "len": 19,
            "nsites": 827,
            "url": "http://jaspar.genereg.net/matrix/MA1062.2",
            "pwm": [
              [0.338566, 0.170502, 0.206773, 0.284159], 
              [0.30713, 0.220073, 0.192265, 0.280532], 
              [0.442543, 0.153575, 0.154784, 0.249096], 
              [0.34582, 0.170502, 0.191056, 0.292622], 
              [0.119729, 0.0520157, 0.797995, 0.0302598], 
              [0.0133329, 0.049598, 0.0121175, 0.924952], 
              [0.0931302, 0.00486338, 0.889883, 0.012124], 
              [0.0024512, 0.00123582, 0.99507, 0.00124234], 
              [0.029051, 0.00365452, 0.952754, 0.0145417], 
              [0.3833, 0.162038, 0.163248, 0.291413], 
              [0.0133329, 0.949126, 0.00486338, 0.0326775], 
              [0.00366105, 0.992652, 0.00123582, 0.0024512], 
              [0.00970632, 0.885047, 0.00607223, 0.0991755], 
              [0.921325, 0.00728108, 0.0580609, 0.0133329], 
              [0.0326775, 0.790741, 0.0556432, 0.120938], 
              [0.297459, 0.189847, 0.165666, 0.347029], 
              [0.25635, 0.16083, 0.140276, 0.442543], 
              [0.297459, 0.188638, 0.205564, 0.308339], 
              [0.286577, 0.211609, 0.169293, 0.33252]
            ]
          }, {
            "db": 0,
            "id": "MA1063.1",
            "alt": "TCP19",
            "len": 10,
            "nsites": 1000,
            "url": "http://jaspar.genereg.net/matrix/MA1063.1",
            "pwm": [
              [0.148013, 0.221, 0.181004, 0.449983], 
              [0.137014, 0.151007, 0.505972, 0.206007], 
              [0.0320245, 0.0070216, 0.845938, 0.115016], 
              [0.112016, 0.0570166, 0.777945, 0.0530224], 
              [0.190009, 0.282994, 0.408981, 0.118016], 
              [0.109017, 0.738948, 0.0220201, 0.130015], 
              [0.0130264, 0.960926, 0.0010222, 0.0250252], 
              [2.76972e-05, 0.998922, 2.22978e-05, 0.0010276], 
              [0.840944, 0.0290194, 0.128009, 0.0020275], 
              [2.76972e-05, 0.812754, 0.106118, 0.0811006]
            ]
          }, {
            "db": 0,
            "id": "MA1064.1",
            "alt": "TCP2",
            "len": 10,
            "nsites": 1000,
            "url": "http://jaspar.genereg.net/matrix/MA1064.1",
            "pwm": [
              [0.217006, 0.168005, 0.428979, 0.186009], 
              [0.0880189, 0.194003, 0.154007, 0.563971], 
              [0.0350242, 2.22978e-05, 0.843938, 0.121016], 
              [2.76972e-05, 2.22978e-05, 0.980924, 0.0190258], 
              [0.0680209, 0.0780145, 0.52097, 0.332994], 
              [0.332994, 0.52097, 0.0780145, 0.0680209], 
              [0.0190258, 0.980924, 2.22978e-05, 2.76972e-05], 
              [0.121016, 0.843938, 2.22978e-05, 0.0350242], 
              [0.563971, 0.154007, 0.194003, 0.0880189], 
              [0.186009, 0.428979, 0.168005, 0.217006]
            ]
          }, {
            "db": 0,
            "id": "MA1065.2",
            "alt": "TCP20",
            "len": 19,
            "nsites": 970,
            "url": "http://jaspar.genereg.net/matrix/MA1065.2",
            "pwm": [
              [0.338138, 0.175263, 0.221649, 0.264949], 
              [0.312367, 0.235051, 0.192787, 0.259796], 
              [0.418542, 0.170108, 0.160831, 0.250518], 
              [0.342261, 0.181447, 0.204126, 0.272165], 
              [0.109295, 0.0536255, 0.790663, 0.0464158], 
              [0.0196145, 0.0546564, 0.0123927, 0.913336], 
              [0.0794014, 0.00723824, 0.904054, 0.0093056], 
              [0.00415213, 0.00105388, 0.991674, 0.00312123], 
              [0.0381686, 0.00311567, 0.942194, 0.0165219], 
              [0.39071, 0.162893, 0.163924, 0.282473], 
              [0.0134292, 0.943225, 0.00414656, 0.0391995], 
              [0.00415213, 0.991674, 2.29873e-05, 0.00415213], 
              [0.0093056, 0.903023, 0.00414656, 0.0835249], 
              [0.914367, 0.00826914, 0.0629035, 0.0144601], 
              [0.0361068, 0.792725, 0.0618726, 0.109295], 
              [0.369063, 0.186602, 0.177325, 0.267011], 
              [0.280412, 0.149493, 0.161862, 0.408233], 
              [0.285566, 0.186602, 0.221649, 0.306183], 
              [0.279381, 0.228865, 0.162893, 0.328861]
            ]
          }, {
            "db": 0,
            "id": "MA1066.1",
            "alt": "TCP23",
            "len": 8,
            "nsites": 1000,
            "url": "http://jaspar.genereg.net/matrix/MA1066.1",
            "pwm": [
              [0.0050272, 0.003022, 0.965926, 0.0260251], 
              [0.0100267, 0.0050218, 0.979924, 0.0050272], 
              [0.036987, 0.0879255, 0.834105, 0.0409826], 
              [0.007034, 0.971897, 0.0080295, 0.0130394], 
              [0.0040273, 0.983924, 0.0080215, 0.0040273], 
              [0.0120145, 0.978945, 0.003019, 0.0060211], 
              [0.953932, 0.0100213, 0.0310192, 0.0050272], 
              [0.0100167, 0.957969, 0.0110102, 0.0210046]
            ]
          }, {
            "db": 0,
            "id": "MA1067.1",
            "alt": "TCP5",
            "len": 8,
            "nsites": 999,
            "url": "http://jaspar.genereg.net/matrix/MA1067.1",
            "pwm": [
              [0.00202952, 0.00202412, 0.993917, 0.00202952], 
              [0.00202552, 0.00202012, 0.993929, 0.00202552], 
              [0.00202552, 0.00202012, 0.993929, 0.00202552], 
              [0.993934, 0.00202012, 0.00202012, 0.00202552], 
              [0.00202552, 0.993929, 0.00202012, 0.00202552], 
              [0.00202552, 0.993929, 0.00202012, 0.00202552], 
              [0.993934, 0.00202012, 0.00202012, 0.00202552], 
              [0.00202952, 0.745694, 0.00202412, 0.250253]
            ]
          }, {
            "db": 0,
            "id": "MA1095.1",
            "alt": "ARALYDRAFT_495258",
            "len": 8,
            "nsites": 999,
            "url": "http://jaspar.genereg.net/matrix/MA1095.1",
            "pwm": [
              [0.00202952, 0.00202412, 0.993917, 0.00202952], 
              [0.250253, 0.00202412, 0.745694, 0.00202952], 
              [0.00202752, 0.497972, 0.497972, 0.00202752], 
              [0.00202952, 0.993917, 0.00202412, 0.00202952], 
              [0.00202952, 0.993917, 0.00202412, 0.00202952], 
              [0.00202952, 0.993917, 0.00202412, 0.00202952], 
              [0.993922, 0.00202412, 0.00202412, 0.00202952], 
              [0.00303042, 0.990914, 0.00302502, 0.00303042]
            ]
          }, {
            "db": 0,
            "id": "MA1096.1",
            "alt": "ARALYDRAFT_496250",
            "len": 8,
            "nsites": 999,
            "url": "http://jaspar.genereg.net/matrix/MA1096.1",
            "pwm": [
              [0.00303042, 0.00302502, 0.990914, 0.00303042], 
              [0.00202752, 0.00202212, 0.993923, 0.00202752], 
              [0.00202752, 0.00202212, 0.993923, 0.00202752], 
              [0.993928, 0.00202212, 0.00202212, 0.00202752], 
              [0.00202752, 0.993923, 0.00202212, 0.00202752], 
              [0.00202752, 0.993923, 0.00202212, 0.00202752], 
              [0.993928, 0.00202212, 0.00202212, 0.00202752], 
              [0.00303042, 0.990914, 0.00302502, 0.00303042]
            ]
          }, {
            "db": 0,
            "id": "MA1097.1",
            "alt": "ARALYDRAFT_493022",
            "len": 8,
            "nsites": 999,
            "url": "http://jaspar.genereg.net/matrix/MA1097.1",
            "pwm": [
              [0.00303042, 0.00302502, 0.990914, 0.00303042], 
              [0.00303042, 0.00302502, 0.990914, 0.00303042], 
              [0.00303042, 0.332321, 0.661618, 0.00303042], 
              [0.332326, 0.661618, 0.00302502, 0.00303042], 
              [0.00303042, 0.990914, 0.00302502, 0.00303042], 
              [0.00303042, 0.990914, 0.00302502, 0.00303042], 
              [0.99092, 0.00302502, 0.00302502, 0.00303042], 
              [0.00502722, 0.984924, 0.00502182, 0.00502722]
            ]
          }, {
            "db": 0,
            "id": "MA1098.1",
            "alt": "ARALYDRAFT_484486",
            "len": 8,
            "nsites": 999,
            "url": "http://jaspar.genereg.net/matrix/MA1098.1",
            "pwm": [
              [0.00202952, 0.00202412, 0.993917, 0.00202952], 
              [0.250253, 0.00202412, 0.745694, 0.00202952], 
              [0.00202752, 0.497972, 0.497972, 0.00202752], 
              [0.00202952, 0.993917, 0.00202412, 0.00202952], 
              [0.00202952, 0.993917, 0.00202412, 0.00202952], 
              [0.00202952, 0.993917, 0.00202412, 0.00202952], 
              [0.993922, 0.00202412, 0.00202412, 0.00202952], 
              [0.00303042, 0.990914, 0.00302502, 0.00303042]
            ]
          }, {
            "db": 0,
            "id": "MA1107.2",
            "alt": "KLF9",
            "len": 16,
            "nsites": 25579,
            "url": "http://jaspar.genereg.net/matrix/MA1107.2",
            "pwm": [
              [0.209508, 0.407052, 0.203292, 0.180148], 
              [0.313343, 0.199695, 0.304117, 0.182845], 
              [0.11189, 0.169749, 0.65882, 0.0595419], 
              [0.182337, 0.697406, 0.0648976, 0.0553589], 
              [0.011221, 0.965985, 0.0113778, 0.011417], 
              [0.85613, 0.100043, 0.0276798, 0.016147], 
              [0.00864105, 0.972005, 0.0138008, 0.00555206], 
              [0.750106, 0.0418317, 0.16967, 0.0383919], 
              [0.00875805, 0.952536, 0.0287358, 0.00997004], 
              [0.0949227, 0.864652, 0.0236528, 0.016773], 
              [0.00570906, 0.964929, 0.00801484, 0.021347], 
              [0.736422, 0.169631, 0.0333097, 0.0606368], 
              [0.030964, 0.807066, 0.0695106, 0.0924597], 
              [0.271629, 0.343915, 0.128582, 0.255874], 
              [0.160679, 0.411274, 0.172915, 0.255131], 
              [0.229681, 0.37214, 0.222096, 0.176082]
            ]
          }, {
            "db": 0,
            "id": "MA1282.1",
            "alt": "PTF1",
            "len": 13,
            "nsites": 130,
            "url": "http://jaspar.genereg.net/matrix/MA1282.1",
            "pwm": [
              [0.130881, 0.0693492, 0.738066, 0.0617036], 
              [0.0463314, 0.0847214, 0.053976, 0.814971], 
              [0.0847629, 0.0693492, 0.745752, 0.100136], 
              [0.000212913, 0.000171407, 0.991717, 0.007899], 
              [0.000212913, 0.000171407, 0.999403, 0.000212913], 
              [0.000212913, 0.000171407, 0.999403, 0.000212913], 
              [0.761166, 0.161585, 0.000171407, 0.0770768], 
              [0.000212913, 0.991717, 0.000171407, 0.007899], 
              [0.000212913, 0.999403, 0.000171407, 0.000212913], 
              [0.92258, 0.000171407, 0.0770353, 0.000212913], 
              [0.000212913, 0.89948, 0.0462899, 0.0540175], 
              [0.438338, 0.123154, 0.0924085, 0.346101], 
              [0.384532, 0.0770353, 0.207704, 0.330728]
            ]
          }, {
            "db": 0,
            "id": "MA1283.1",
            "alt": "TCP14",
            "len": 20,
            "nsites": 47,
            "url": "http://jaspar.genereg.net/matrix/MA1283.1",
            "pwm": [
              [0.658762, 0.106631, 0.106631, 0.127977], 
              [0.276597, 0.340177, 0.276482, 0.106745], 
              [0.849845, 0.000473461, 0.0853988, 0.0642826], 
              [0.297828, 0.0429361, 0.382639, 0.276597], 
              [0.764919, 0.0429361, 0.0853988, 0.106745], 
              [0.106745, 0.106631, 0.594954, 0.191671], 
              [0.212902, 0.297713, 0.382639, 0.106745], 
              [0.467679, 0.0429361, 0.25525, 0.234134], 
              [0.0430508, 0.212788, 0.340177, 0.403985], 
              [0.00058811, 0.000473461, 0.99835, 0.00058811], 
              [0.00058811, 0.000473461, 0.000473461, 0.998465], 
              [0.0430508, 0.000473461, 0.955888, 0.00058811], 
              [0.00058811, 0.000473461, 0.99835, 0.00058811], 
              [0.00058811, 0.000473461, 0.99835, 0.00058811], 
              [0.403985, 0.000473461, 0.382639, 0.212902], 
              [0.00058811, 0.99835, 0.000473461, 0.00058811], 
              [0.00058811, 0.99835, 0.000473461, 0.00058811], 
              [0.00058811, 0.99835, 0.000473461, 0.00058811], 
              [0.91354, 0.000473461, 0.0853988, 0.00058811], 
              [0.00058811, 0.99835, 0.000473461, 0.00058811]
            ]
          }, {
            "db": 0,
            "id": "MA1284.1",
            "alt": "TCP1",
            "len": 30,
            "nsites": 95,
            "url": "http://jaspar.genereg.net/matrix/MA1284.1",
            "pwm": [
              [0.37884, 0.073841, 0.168478, 0.37884], 
              [0.042352, 0.073841, 0.883516, 0.000291272], 
              [0.000291272, 0.0633261, 0.0528111, 0.883573], 
              [0.000291272, 0.00023449, 0.999183, 0.000291272], 
              [0.000291272, 0.00023449, 0.999183, 0.000291272], 
              [0.000291272, 0.00023449, 0.999183, 0.000291272], 
              [0.0844137, 0.568058, 0.0843569, 0.263173], 
              [0.000291272, 0.988668, 0.0107494, 0.000291272], 
              [0.000291272, 0.999183, 0.00023449, 0.000291272], 
              [0.0949287, 0.862485, 0.00023449, 0.042352], 
              [0.547084, 0.273631, 0.0843569, 0.0949287], 
              [0.15802, 0.641664, 0.0212654, 0.17905], 
              [0.168535, 0.357753, 0.23157, 0.242142], 
              [0.136989, 0.23157, 0.126418, 0.505023], 
              [0.221112, 0.389299, 0.157963, 0.231627], 
              [0.210596, 0.357753, 0.105387, 0.326264], 
              [0.168535, 0.294662, 0.0843569, 0.452447], 
              [0.242142, 0.452391, 0.115902, 0.189566], 
              [0.263173, 0.189509, 0.126418, 0.420902], 
              [0.168535, 0.326207, 0.263116, 0.242142], 
              [0.231627, 0.23157, 0.178993, 0.35781], 
              [0.242142, 0.273631, 0.115902, 0.368325], 
              [0.15802, 0.136933, 0.378783, 0.326264], 
              [0.210596, 0.115902, 0.420845, 0.252658], 
              [0.15802, 0.157963, 0.378783, 0.305233], 
              [0.294718, 0.378783, 0.105387, 0.221112], 
              [0.200081, 0.389299, 0.157963, 0.252658], 
              [0.231627, 0.284147, 0.189509, 0.294718], 
              [0.37884, 0.200024, 0.221055, 0.200081], 
              [0.126474, 0.368268, 0.0843569, 0.420902]
            ]
          }, {
            "db": 0,
            "id": "MA1285.1",
            "alt": "At2g45680",
            "len": 21,
            "nsites": 395,
            "url": "http://jaspar.genereg.net/matrix/MA1285.1",
            "pwm": [
              [0.194958, 0.486009, 0.151917, 0.167117], 
              [0.215206, 0.518912, 0.144324, 0.121558], 
              [0.493616, 0.200006, 0.129138, 0.17724], 
              [0.164585, 0.225315, 0.124076, 0.486023], 
              [0.12662, 0.139262, 0.197474, 0.536643], 
              [0.260763, 0.146854, 0.106359, 0.486023], 
              [0.164585, 0.232908, 0.382238, 0.220267], 
              [0.232922, 0.430328, 0.0759862, 0.260763], 
              [0.225329, 0.420203, 0.0861107, 0.268356], 
              [0.116497, 0.0329591, 0.84035, 0.0101945], 
              [0.00260147, 0.0481453, 0.0025878, 0.946665], 
              [0.0405659, 5.64414e-05, 0.959308, 7.01088e-05], 
              [0.00260147, 5.64414e-05, 0.997272, 7.01088e-05], 
              [0.0608137, 5.64414e-05, 0.936528, 0.00260147], 
              [0.134213, 0.245564, 0.0582697, 0.561953], 
              [7.01088e-05, 0.982086, 5.64414e-05, 0.0177876], 
              [0.00513183, 0.994742, 5.64414e-05, 7.01088e-05], 
              [0.00260147, 0.93906, 0.0025878, 0.055752], 
              [0.901108, 0.0025878, 0.0962351, 7.01088e-05], 
              [0.00513183, 0.875784, 0.0278974, 0.091186], 
              [0.263294, 0.450575, 0.0911724, 0.194958]
            ]
          }, {
            "db": 0,
            "id": "MA1286.1",
            "alt": "TCP24",
            "len": 12,
            "nsites": 594,
            "url": "http://jaspar.genereg.net/matrix/MA1286.1",
            "pwm": [
              [0.257579, 0.136379, 0.360246, 0.245796], 
              [0.190251, 0.181825, 0.15826, 0.469665], 
              [0.124605, 0.168359, 0.329948, 0.377087], 
              [0.0202452, 0.0185534, 0.930857, 0.0303445], 
              [4.66251e-05, 3.75358e-05, 0.998185, 0.00173034], 
              [4.66251e-05, 3.75358e-05, 0.999869, 4.66251e-05], 
              [0.887102, 0.0404347, 0.0438012, 0.0286618], 
              [4.66251e-05, 0.999869, 3.75358e-05, 4.66251e-05], 
              [4.66251e-05, 0.999869, 3.75358e-05, 4.66251e-05], 
              [0.954431, 3.75358e-05, 0.0454849, 4.66251e-05], 
              [0.0269781, 0.94264, 0.015187, 0.0151961], 
              [0.328274, 0.323215, 0.0673662, 0.281144]
            ]
          }, {
            "db": 0,
            "id": "MA1287.1",
            "alt": "TCP21",
            "len": 14,
            "nsites": 598,
            "url": "http://jaspar.genereg.net/matrix/MA1287.1",
            "pwm": [
              [0.314375, 0.128779, 0.165562, 0.391285], 
              [0.0585645, 0.00839689, 0.932991, 4.63133e-05], 
              [4.63133e-05, 0.0334767, 3.72848e-05, 0.96644], 
              [4.63133e-05, 3.72848e-05, 0.99987, 4.63133e-05], 
              [4.63133e-05, 3.72848e-05, 0.99987, 4.63133e-05], 
              [0.0903322, 0.00170901, 0.869457, 0.0385019], 
              [0.257528, 0.483234, 0.0552121, 0.204025], 
              [4.63133e-05, 0.998198, 3.72848e-05, 0.00171803], 
              [0.0251261, 0.973119, 3.72848e-05, 0.00171803], 
              [0.103708, 0.693901, 0.0234444, 0.178946], 
              [0.708958, 0.0618999, 0.14717, 0.0819726], 
              [0.0970201, 0.56516, 0.108715, 0.229105], 
              [0.255857, 0.250831, 0.197328, 0.295984], 
              [0.269232, 0.173921, 0.160545, 0.396301]
            ]
          }, {
            "db": 0,
            "id": "MA1288.1",
            "alt": "At1g72010",
            "len": 13,
            "nsites": 595,
            "url": "http://jaspar.genereg.net/matrix/MA1288.1",
            "pwm": [
              [0.381495, 0.156314, 0.1832, 0.278992], 
              [0.277311, 0.146231, 0.188241, 0.388216], 
              [0.0202112, 0.00339791, 0.976344, 4.65468e-05], 
              [4.65468e-05, 0.0420474, 3.74727e-05, 0.957869], 
              [0.00172726, 3.74727e-05, 0.998189, 4.65468e-05], 
              [4.65468e-05, 3.74727e-05, 0.999869, 4.65468e-05], 
              [0.0958284, 0.00507863, 0.862078, 0.0370153], 
              [0.289074, 0.381486, 0.0975001, 0.231941], 
              [4.65468e-05, 0.999869, 3.74727e-05, 4.65468e-05], 
              [0.00172726, 0.998189, 3.74727e-05, 4.65468e-05], 
              [0.0756638, 0.737728, 0.0151609, 0.171447], 
              [0.741098, 0.0420474, 0.146231, 0.0706227], 
              [0.0857461, 0.539443, 0.117665, 0.257146]
            ]
          }, {
            "db": 0,
            "id": "MA1289.1",
            "alt": "TCP3",
            "len": 13,
            "nsites": 582,
            "url": "http://jaspar.genereg.net/matrix/MA1289.1",
            "pwm": [
              [0.283504, 0.118575, 0.359084, 0.238839], 
              [0.209634, 0.16324, 0.132318, 0.494808], 
              [0.0996865, 0.152933, 0.317853, 0.429527], 
              [0.003483, 0.00347372, 0.967226, 0.0258162], 
              [4.75863e-05, 3.83096e-05, 0.999867, 4.75863e-05], 
              [4.75863e-05, 3.83096e-05, 0.999867, 4.75863e-05], 
              [0.86416, 0.0876523, 3.83096e-05, 0.0481493], 
              [4.75863e-05, 0.999867, 3.83096e-05, 4.75863e-05], 
              [4.75863e-05, 0.999867, 3.83096e-05, 4.75863e-05], 
              [0.934595, 3.83096e-05, 0.0653191, 4.75863e-05], 
              [0.00176529, 0.963791, 0.0103455, 0.0240985], 
              [0.3694, 0.264598, 0.0876523, 0.278351], 
              [0.33676, 0.127164, 0.178702, 0.357374]
            ]
          }, {
            "db": 0,
            "id": "MA1290.1",
            "alt": "TCP17",
            "len": 11,
            "nsites": 108,
            "url": "http://jaspar.genereg.net/matrix/MA1290.1",
            "pwm": [
              [0.0742617, 0.0557109, 0.85127, 0.0187581], 
              [0.0187581, 0.0464595, 0.000206291, 0.934576], 
              [0.000256244, 0.0187082, 0.971529, 0.00950668], 
              [0.000256244, 0.000206291, 0.980779, 0.0187581], 
              [0.0280085, 0.000206291, 0.18522, 0.786565], 
              [0.00950668, 0.990031, 0.000206291, 0.000256244], 
              [0.000256244, 0.999281, 0.000206291, 0.000256244], 
              [0.00950668, 0.980779, 0.00945673, 0.000256244], 
              [0.157518, 0.740262, 0.0464595, 0.0557609], 
              [0.832818, 0.0557109, 0.0557109, 0.0557609], 
              [0.0835122, 0.71251, 0.0834622, 0.120515]
            ]
          }, {
            "db": 0,
            "id": "MA1291.1",
            "alt": "TCP7",
            "len": 11,
            "nsites": 588,
            "url": "http://jaspar.genereg.net/matrix/MA1291.1",
            "pwm": [
              [0.00174781, 3.79187e-05, 0.998167, 4.71008e-05], 
              [4.71008e-05, 0.0255436, 3.79187e-05, 0.974371], 
              [0.115673, 3.79187e-05, 0.884242, 4.71008e-05], 
              [4.71008e-05, 3.79187e-05, 0.999868, 4.71008e-05], 
              [0.00684894, 0.00173863, 0.991366, 4.71008e-05], 
              [0.387736, 0.156474, 0.275501, 0.180288], 
              [0.0374557, 0.874039, 3.79187e-05, 0.0884671], 
              [0.00344752, 0.996467, 3.79187e-05, 4.71008e-05], 
              [0.0425569, 0.945455, 0.00683976, 0.00514823], 
              [0.766924, 0.0510492, 0.127567, 0.0544598], 
              [0.071464, 0.545863, 0.112264, 0.270409]
            ]
          }, {
            "db": 0,
            "id": "MA1410.1",
            "alt": "StBRC1",
            "len": 10,
            "nsites": 100001,
            "url": "http://jaspar.genereg.net/matrix/MA1410.1",
            "pwm": [
              [0.114979, 0.236828, 0.365976, 0.282217], 
              [0.0243703, 0.0208202, 0.930149, 0.0246603], 
              [0.00419027, 0.00447022, 0.984999, 0.00634027], 
              [0.0440202, 0.14768, 0.750889, 0.0574102], 
              [0.0460202, 0.5971, 0.31742, 0.0394602], 
              [0.00925027, 0.976599, 0.00962021, 0.00453027], 
              [0.0657092, 0.91693, 0.0103102, 0.00705027], 
              [0.30634, 0.5283, 0.11378, 0.0515802], 
              [0.165898, 0.520865, 0.0976491, 0.215588], 
              [0.14072, 0.48745, 0.17972, 0.19211]
            ]
          }, {
            "db": 0,
            "id": "MA1419.1",
            "alt": "IRF4",
            "len": 15,
            "nsites": 45330,
            "url": "http://jaspar.genereg.net/matrix/MA1419.1",
            "pwm": [
              [0.230488, 0.416413, 0.0464374, 0.306662], 
              [0.0070386, 0.876485, 0.00168249, 0.114793], 
              [0.00764659, 0.00144249, 0.990233, 0.00067761], 
              [0.992836, 0.00271649, 0.00199349, 0.00245361], 
              [0.989585, 0.000175492, 0.000546491, 0.00969359], 
              [0.999601, 0.000132492, 8.84918e-05, 0.000176611], 
              [0.0040126, 0.972599, 0.0127235, 0.0106636], 
              [0.00054961, 0.922053, 8.14918e-05, 0.0773144], 
              [0.00125661, 0.000132492, 0.998544, 6.66109e-05], 
              [0.99872, 0.00101349, 0.000154492, 0.000110611], 
              [0.977655, 0.000237491, 0.000496491, 0.0216106], 
              [0.999293, 0.000331491, 8.84918e-05, 0.00028761], 
              [0.0164196, 0.897803, 0.0841933, 0.00158461], 
              [0.0293225, 0.374545, 0.00538748, 0.590745], 
              [0.555942, 0.102356, 0.124504, 0.217198]
            ]
          }, {
            "db": 0,
            "id": "MA1420.1",
            "alt": "IRF5",
            "len": 14,
            "nsites": 268,
            "url": "http://jaspar.genereg.net/matrix/MA1420.1",
            "pwm": [
              [0.130652, 0.630445, 0.0821426, 0.156761], 
              [0.0414099, 0.731215, 0.070305, 0.15707], 
              [0.0379682, 0.00765635, 0.901262, 0.0531135], 
              [0.936729, 0.00848304, 0.0252838, 0.0295043], 
              [0.808466, 0.0181274, 0.0145178, 0.158889], 
              [0.973766, 8.3178e-05, 0.0217201, 0.0044307], 
              [0.0055063, 0.972693, 8.3178e-05, 0.0217173], 
              [0.00010332, 0.830823, 8.3178e-05, 0.16899], 
              [0.206719, 0.0591162, 0.718319, 0.0158454], 
              [0.92157, 0.0453333, 0.0288794, 0.00421678], 
              [0.743508, 0.0217361, 0.0903025, 0.144453], 
              [0.667519, 0.251486, 0.0359978, 0.0449966], 
              [0.117469, 0.692133, 0.10126, 0.0891391], 
              [0.0780882, 0.283665, 0.0816128, 0.556634]
            ]
          }, {
            "db": 0,
            "id": "MA1428.1",
            "alt": "TCP8",
            "len": 9,
            "nsites": 998,
            "url": "http://jaspar.genereg.net/matrix/MA1428.1",
            "pwm": [
              [0.172355, 0.240479, 0.373732, 0.213433], 
              [0.0411466, 0.0150658, 0.803352, 0.140435], 
              [0.1433, 0.0290774, 0.726403, 0.10122], 
              [0.150163, 0.255252, 0.433412, 0.161173], 
              [0.160493, 0.653919, 0.063206, 0.122382], 
              [0.0321205, 0.965824, 0.00202814, 2.77527e-05], 
              [0.0200657, 0.90374, 2.23425e-05, 0.0761721], 
              [0.865672, 0.00102424, 0.113237, 0.0200657], 
              [0.0320565, 0.725676, 0.0971096, 0.145158]
            ]
          }, {
            "db": 0,
            "id": "MA1430.1",
            "alt": "TB1",
            "len": 10,
            "nsites": 999,
            "url": "http://jaspar.genereg.net/matrix/MA1430.1",
            "pwm": [
              [2.77249e-05, 2.23201e-05, 0.999922, 2.77249e-05], 
              [2.77249e-05, 2.23201e-05, 0.999922, 2.77249e-05], 
              [0.0841873, 0.308608, 0.519008, 0.0881949], 
              [2.77249e-05, 0.999922, 2.23201e-05, 2.77249e-05], 
              [2.77249e-05, 0.999922, 2.23201e-05, 2.77249e-05], 
              [0.0410646, 0.958885, 2.23201e-05, 2.77249e-05], 
              [0.037135, 0.955795, 2.23201e-05, 0.00704802], 
              [0.153165, 0.839778, 0.00402592, 0.00303042], 
              [0.143156, 0.648606, 0.013034, 0.195203], 
              [0.385761, 0.405794, 0.119248, 0.0891968]
            ]
          }, {
            "db": 0,
            "id": "MA1460.1",
            "alt": "pho",
            "len": 11,
            "nsites": 6951,
            "url": "http://jaspar.genereg.net/matrix/MA1460.1",
            "pwm": [
              [0.32988, 0.250036, 0.183572, 0.236514], 
              [0.324557, 0.170048, 0.294921, 0.210474], 
              [0.890654, 0.0427306, 0.0385587, 0.0280576], 
              [0.0149658, 0.0221579, 0.017842, 0.945034], 
              [0.0205767, 0.0457515, 0.906766, 0.0269066], 
              [0.0166917, 0.0215829, 0.937409, 0.0243166], 
              [0.0430184, 0.874685, 0.0394216, 0.0428754], 
              [0.0489173, 0.753265, 0.132788, 0.06503], 
              [0.071647, 0.0257548, 0.862457, 0.0401414], 
              [0.268451, 0.346135, 0.177673, 0.207741], 
              [0.190621, 0.361241, 0.215796, 0.232342]
            ]
          }, {
            "db": 0,
            "id": "MA1462.1",
            "alt": "vfl",
            "len": 12,
            "nsites": 11731,
            "url": "http://jaspar.genereg.net/matrix/MA1462.1",
            "pwm": [
              [0.253857, 0.264854, 0.231182, 0.250107], 
              [0.249339, 0.235018, 0.233569, 0.282073], 
              [0.194614, 0.166482, 0.442671, 0.196233], 
              [0.00443532, 0.909379, 0.0153458, 0.0708398], 
              [0.974762, 0.00238888, 0.0138968, 0.00895328], 
              [0.00366833, 0.00494586, 0.988996, 0.00238934], 
              [0.0077593, 0.00451986, 0.984139, 0.00358233], 
              [0.00793029, 0.0587344, 0.00315587, 0.930179], 
              [0.976893, 0.0106578, 0.00801483, 0.00443532], 
              [0.182679, 0.148837, 0.585028, 0.0834556], 
              [0.278749, 0.24448, 0.282072, 0.194699], 
              [0.269116, 0.270139, 0.201517, 0.259228]
            ]
          }, {
            "db": 0,
            "id": "MA1483.1",
            "alt": "ELF2",
            "len": 12,
            "nsites": 20352,
            "url": "http://jaspar.genereg.net/matrix/MA1483.1",
            "pwm": [
              [0.488108, 0.143131, 0.166175, 0.202585], 
              [0.762188, 0.0741897, 0.01603, 0.147593], 
              [0.205044, 0.682539, 0.0328669, 0.07955], 
              [0.0239462, 0.895811, 0.0794937, 0.000749357], 
              [0.0282512, 0.971174, 0.000240095, 0.000335359], 
              [1.36104e-06, 1.09571e-06, 0.999996, 1.36104e-06], 
              [0.00103136, 9.90952e-05, 0.998475, 0.000393359], 
              [0.999456, 0.000247095, 0.000296094, 1.36104e-06], 
              [0.99535, 0.000294094, 1.09571e-06, 0.00435434], 
              [0.1309, 0.016054, 0.853044, 1.36104e-06], 
              [0.0387432, 0.120527, 0.00725006, 0.83348], 
              [0.395076, 0.134771, 0.357588, 0.112564]
            ]
          }, {
            "db": 0,
            "id": "MA1508.1",
            "alt": "IKZF1",
            "len": 12,
            "nsites": 10918,
            "url": "http://jaspar.genereg.net/matrix/MA1508.1",
            "pwm": [
              [0.301795, 0.188221, 0.354734, 0.155249], 
              [0.383494, 0.209929, 0.262685, 0.143892], 
              [0.743905, 0.106064, 0.0922342, 0.057796], 
              [0.83687, 0.0433246, 0.0875632, 0.0322422], 
              [0.061643, 0.794829, 0.116506, 0.0270223], 
              [0.933681, 0.0194189, 0.0230828, 0.0238163], 
              [0.0114514, 0.00971095, 0.968027, 0.0108104], 
              [0.0382872, 0.0163049, 0.932856, 0.0125504], 
              [0.945497, 0.0226248, 0.0272048, 0.00467349], 
              [0.939177, 0.0104429, 0.0239068, 0.0264723], 
              [0.302253, 0.153417, 0.450538, 0.0937917], 
              [0.203427, 0.273951, 0.212218, 0.310405]
            ]
          }, {
            "db": 0,
            "id": "MA1511.1",
            "alt": "KLF10",
            "len": 11,
            "nsites": 22518,
            "url": "http://jaspar.genereg.net/matrix/MA1511.1",
            "pwm": [
              [0.210765, 0.108137, 0.625542, 0.055557], 
              [0.302063, 0.576254, 0.0591567, 0.062527], 
              [0.0303831, 0.941634, 0.00470497, 0.0232791], 
              [0.846811, 0.0751037, 0.0778126, 0.000272229], 
              [0.0117222, 0.980396, 0.00014899, 0.0077332], 
              [0.665515, 0.000542988, 0.307184, 0.0267581], 
              [5.12299e-05, 0.999847, 0.00010099, 1.23012e-06], 
              [1.23012e-06, 0.999997, 9.90315e-07, 1.23012e-06], 
              [1.23012e-06, 0.897488, 9.90315e-07, 0.10251], 
              [0.339544, 0.513162, 0.0264169, 0.120878], 
              [0.044275, 0.621822, 0.0365008, 0.297402]
            ]
          }, {
            "db": 0,
            "id": "MA1512.1",
            "alt": "KLF11",
            "len": 11,
            "nsites": 9165,
            "url": "http://jaspar.genereg.net/matrix/MA1512.1",
            "pwm": [
              [0.205347, 0.224113, 0.428803, 0.141736], 
              [0.220647, 0.605518, 0.04376, 0.130076], 
              [0.0651713, 0.868451, 0.0156433, 0.0507345], 
              [0.858114, 0.127802, 0.0114043, 0.00267999], 
              [3.02233e-06, 0.995853, 2.43314e-06, 0.00414198], 
              [0.218206, 0.00467938, 0.745722, 0.0313937], 
              [0.00119701, 0.994348, 0.00195641, 0.002499], 
              [0.000112021, 0.996947, 0.00217741, 0.000764014], 
              [3.02233e-06, 0.909556, 0.000409429, 0.090033], 
              [0.481168, 0.433656, 0.00708336, 0.0780932], 
              [0.0546954, 0.791013, 0.0337021, 0.120589]
            ]
          }, {
            "db": 0,
            "id": "MA1513.1",
            "alt": "KLF15",
            "len": 11,
            "nsites": 11369,
            "url": "http://jaspar.genereg.net/matrix/MA1513.1",
            "pwm": [
              [0.104145, 0.255343, 0.487112, 0.153401], 
              [0.0824187, 0.572255, 0.186208, 0.159118], 
              [0.00352041, 0.988119, 0.00756589, 0.000794429], 
              [0.00818236, 0.962259, 0.0292917, 0.000266434], 
              [2.43643e-06, 0.999905, 8.99607e-05, 2.43643e-06], 
              [2.43643e-06, 1.96146e-06, 0.999993, 2.43643e-06], 
              [0.000970428, 0.997882, 0.00017796, 0.000970428], 
              [0.00484039, 0.96349, 0.0315787, 9.04357e-05], 
              [0.00105843, 0.989878, 0.00879788, 0.000266434], 
              [0.137744, 0.551233, 0.170112, 0.14091], 
              [0.0938536, 0.440934, 0.274782, 0.190431]
            ]
          }, {
            "db": 0,
            "id": "MA1522.1",
            "alt": "MAZ",
            "len": 11,
            "nsites": 15063,
            "url": "http://jaspar.genereg.net/matrix/MA1522.1",
            "pwm": [
              [0.164643, 0.345083, 0.283941, 0.206333], 
              [0.12076, 0.336453, 0.342759, 0.200028], 
              [0.00113083, 0.992161, 0.00498045, 0.00172783], 
              [0.00325482, 0.971249, 0.0254943, 1.83893e-06], 
              [0.00239182, 0.977954, 0.0192534, 0.000399836], 
              [0.00259082, 0.974303, 0.0230383, 6.78385e-05], 
              [0.000399836, 1.48044e-06, 0.00863142, 0.990966], 
              [0.0059768, 0.993223, 0.000532477, 0.000267837], 
              [0.00152883, 0.992095, 0.00637444, 1.83893e-06], 
              [0.0736254, 0.622184, 0.117375, 0.186816], 
              [0.133839, 0.449776, 0.168559, 0.247826]
            ]
          }, {
            "db": 0,
            "id": "MA1529.1",
            "alt": "NHLH2",
            "len": 18,
            "nsites": 21364,
            "url": "http://jaspar.genereg.net/matrix/MA1529.1",
            "pwm": [
              [0.226268, 0.124274, 0.455532, 0.193924], 
              [0.168228, 0.0865716, 0.542407, 0.202793], 
              [0.143781, 0.0409329, 0.709095, 0.106193], 
              [0.230341, 0.287446, 0.229732, 0.252481], 
              [0.256125, 0.706297, 0.0306739, 0.00690426], 
              [0.0905359, 0.0884796, 0.720702, 0.100283], 
              [9.52961e-05, 0.999575, 9.50434e-05, 0.000235295], 
              [0.998735, 1.04381e-06, 0.00121604, 4.82963e-05], 
              [0.000255295, 0.10413, 0.850982, 0.0446341], 
              [0.0227692, 0.87896, 0.0982706, 1.29657e-06], 
              [1.29657e-06, 0.000656041, 0.000141043, 0.999202], 
              [1.29657e-06, 9.50434e-05, 0.999902, 1.29657e-06], 
              [0.0303842, 0.903632, 0.012058, 0.053927], 
              [0.00949025, 0.009219, 0.947853, 0.0334381], 
              [0.0505691, 0.307807, 0.0649187, 0.576705], 
              [0.145784, 0.710368, 0.0457948, 0.0980538], 
              [0.258127, 0.543632, 0.0637647, 0.134476], 
              [0.168556, 0.527569, 0.105974, 0.197903]
            ]
          }, {
            "db": 0,
            "id": "MA1548.1",
            "alt": "PLAGL2",
            "len": 10,
            "nsites": 999,
            "url": "http://jaspar.genereg.net/matrix/MA1548.1",
            "pwm": [
              [0.224229, 0.224224, 0.224224, 0.327322], 
              [0.0391018, 0.0390964, 0.81457, 0.107231], 
              [2.77249e-05, 2.23201e-05, 0.999922, 2.77249e-05], 
              [2.77249e-05, 0.151158, 0.848786, 2.77249e-05], 
              [2.77249e-05, 0.799742, 0.200202, 2.77249e-05], 
              [2.77249e-05, 0.999922, 2.23201e-05, 2.77249e-05], 
              [2.77249e-05, 0.999922, 2.23201e-05, 2.77249e-05], 
              [2.77249e-05, 0.925856, 2.23201e-05, 0.0740943], 
              [0.0902897, 0.686012, 0.0250948, 0.198604], 
              [0.210217, 0.210211, 0.210211, 0.36936]
            ]
          }, {
            "db": 0,
            "id": "MA1558.1",
            "alt": "SNAI1",
            "len": 10,
            "nsites": 19983,
            "url": "http://jaspar.genereg.net/matrix/MA1558.1",
            "pwm": [
              [0.263924, 0.159486, 0.320773, 0.255817], 
              [0.291363, 0.020875, 0.541184, 0.146578], 
              [0.0211963, 0.949575, 0.0130691, 0.0161583], 
              [0.954338, 0.014186, 0.00434709, 0.0271293], 
              [0.078243, 0.022906, 0.885292, 0.0135583], 
              [0.00358537, 0.000250115, 0.994769, 0.00139538], 
              [0.00189538, 1.11594e-06, 0.00209511, 0.996008], 
              [0.0336222, 1.11594e-06, 0.951565, 0.0148113], 
              [0.0608691, 0.406208, 0.197051, 0.335871], 
              [0.326156, 0.148464, 0.319884, 0.205496]
            ]
          }, {
            "db": 0,
            "id": "MA1564.1",
            "alt": "SP9",
            "len": 12,
            "nsites": 2452,
            "url": "http://jaspar.genereg.net/matrix/MA1564.1",
            "pwm": [
              [0.340128, 0.179447, 0.388247, 0.0921775], 
              [0.147247, 0.6376, 0.0803908, 0.134761], 
              [0.101301, 0.773408, 0.0356656, 0.0896256], 
              [0.657089, 0.302142, 0.0150215, 0.0257472], 
              [0.000818264, 0.988674, 0.00686681, 0.00364115], 
              [0.0695305, 0.0659044, 0.807554, 0.057011], 
              [0.00885694, 0.985494, 9.09425e-06, 0.00564007], 
              [1.12964e-05, 0.987877, 9.09425e-06, 0.0121028], 
              [0.0133398, 0.837637, 0.00821076, 0.140813], 
              [0.419417, 0.442989, 0.0133795, 0.124214], 
              [0.0664396, 0.658286, 0.0674973, 0.207777], 
              [0.171363, 0.476122, 0.0832367, 0.269278]
            ]
          }, {
            "db": 0,
            "id": "MA1599.1",
            "alt": "ZNF682",
            "len": 16,
            "nsites": 1058,
            "url": "http://jaspar.genereg.net/matrix/MA1599.1",
            "pwm": [
              [0.19377, 0.399794, 0.20227, 0.204166], 
              [0.287334, 0.221172, 0.329858, 0.161637], 
              [0.103986, 0.0803535, 0.731521, 0.0841392], 
              [0.09737, 0.0397153, 0.828865, 0.034049], 
              [0.0945352, 0.751368, 0.0992557, 0.054841], 
              [0.0453909, 0.56424, 0.0520012, 0.338368], 
              [0.900697, 0.0680676, 0.0189233, 0.012312], 
              [0.944171, 0.0293193, 0.0208131, 0.00569664], 
              [0.00569664, 0.00663645, 0.981024, 0.00664155], 
              [0.012312, 0.944166, 0.0123069, 0.0312142], 
              [0.00475173, 0.9763, 0.00852727, 0.0104222], 
              [0.00664155, 0.977245, 0.00947218, 0.00664155], 
              [0.0624023, 0.846822, 0.0302642, 0.0605115], 
              [0.346874, 0.110597, 0.111542, 0.430987], 
              [0.306235, 0.240074, 0.283548, 0.170142], 
              [0.181483, 0.245745, 0.183369, 0.389403]
            ]
          }, {
            "db": 0,
            "id": "MA1686.1",
            "alt": "ARF13",
            "len": 14,
            "nsites": 8406,
            "url": "http://jaspar.genereg.net/matrix/MA1686.1",
            "pwm": [
              [0.688551, 0.0944575, 0.0775657, 0.139426], 
              [0.409943, 0.0645989, 0.476918, 0.0485397], 
              [0.0676925, 0.800017, 0.055082, 0.0772094], 
              [0.0685245, 0.0172524, 0.882695, 0.0315279], 
              [0.0390228, 0.00345261, 0.951811, 0.00571323], 
              [0.00654622, 0.00654558, 0.983931, 0.00297726], 
              [0.0318849, 0.00797256, 0.954309, 0.00583223], 
              [0.0140411, 0.0102335, 0.972511, 0.00321526], 
              [0.873655, 0.0132075, 0.112183, 0.000955284], 
              [0.00428624, 0.985478, 0.00654558, 0.00369125], 
              [0.946102, 0.00392861, 0.0467541, 0.00321526], 
              [0.0891052, 0.509514, 0.0254603, 0.375921], 
              [0.0632905, 0.0616249, 0.798232, 0.0768524], 
              [0.0886292, 0.0613869, 0.104093, 0.74589]
            ]
          }, {
            "db": 0,
            "id": "MA1695.1",
            "alt": "ARF36",
            "len": 14,
            "nsites": 11250,
            "url": "http://jaspar.genereg.net/matrix/MA1695.1",
            "pwm": [
              [0.385155, 0.121601, 0.397331, 0.0959126], 
              [0.139734, 0.536441, 0.146312, 0.177512], 
              [0.0983126, 0.0706684, 0.788084, 0.0429351], 
              [0.0389351, 0.0107579, 0.92915, 0.0211583], 
              [0.046758, 0.00764591, 0.939372, 0.00622441], 
              [0.133957, 0.0115579, 0.847816, 0.0066694], 
              [0.048091, 0.0106689, 0.932883, 0.00835839], 
              [0.931816, 0.00773491, 0.0579575, 0.00249144], 
              [0.0072914, 0.980615, 0.00737992, 0.00471342], 
              [0.963461, 0.00471294, 0.0280907, 0.00373543], 
              [0.303022, 0.396087, 0.0528905, 0.248], 
              [0.0831127, 0.140979, 0.650929, 0.124979], 
              [0.0966236, 0.128357, 0.217956, 0.557065], 
              [0.113157, 0.597597, 0.0674684, 0.221778]
            ]
          }, {
            "db": 0,
            "id": "MA1696.1",
            "alt": "ARF39",
            "len": 12,
            "nsites": 4068,
            "url": "http://jaspar.genereg.net/matrix/MA1696.1",
            "pwm": [
              [0.132502, 0.49311, 0.157573, 0.216815], 
              [0.176993, 0.141595, 0.583324, 0.0980874], 
              [0.126356, 0.00787129, 0.859374, 0.00639765], 
              [0.0113145, 0.00664232, 0.979086, 0.00295674], 
              [0.074243, 0.0113132, 0.88789, 0.0265552], 
              [0.516464, 0.00713431, 0.463121, 0.0132805], 
              [0.942216, 0.00713431, 0.0422854, 0.0083646], 
              [0.0142645, 0.965075, 0.0152461, 0.00541468], 
              [0.94787, 0.0260618, 0.0169671, 0.00910159], 
              [0.169128, 0.450338, 0.171338, 0.209196], 
              [0.114557, 0.253195, 0.555056, 0.0771929], 
              [0.154624, 0.127091, 0.164455, 0.553828]
            ]
          }
        ],
        "all_matches": [
          {
            "idx": 2,
            "matches": [
              {
                "idx": 33,
                "rc": true,
                "off": -5,
                "pv": "3.39e-07",
                "ev": "5.59e-04",
                "qv": "2.75e-04"
              }, {
                "idx": 29,
                "rc": true,
                "off": -5,
                "pv": "3.40e-07",
                "ev": "5.60e-04",
                "qv": "2.75e-04"
              }, {
                "idx": 49,
                "rc": false,
                "off": -3,
                "pv": "3.98e-07",
                "ev": "6.55e-04",
                "qv": "2.75e-04"
              }, {
                "idx": 51,
                "rc": false,
                "off": -5,
                "pv": "5.07e-07",
                "ev": "8.34e-04",
                "qv": "2.75e-04"
              }, {
                "idx": 52,
                "rc": true,
                "off": -5,
                "pv": "5.07e-07",
                "ev": "8.34e-04",
                "qv": "2.75e-04"
              }, {
                "idx": 56,
                "rc": true,
                "off": -5,
                "pv": "5.08e-07",
                "ev": "8.36e-04",
                "qv": "2.75e-04"
              }, {
                "idx": 26,
                "rc": true,
                "off": -5,
                "pv": "7.26e-07",
                "ev": "1.20e-03",
                "qv": "3.36e-04"
              }, {
                "idx": 36,
                "rc": true,
                "off": -5,
                "pv": "8.61e-07",
                "ev": "1.42e-03",
                "qv": "3.49e-04"
              }, {
                "idx": 45,
                "rc": true,
                "off": 13,
                "pv": "3.53e-06",
                "ev": "5.82e-03",
                "qv": "1.27e-03"
              }, {
                "idx": 40,
                "rc": true,
                "off": -5,
                "pv": "3.97e-06",
                "ev": "6.53e-03",
                "qv": "1.29e-03"
              }, {
                "idx": 47,
                "rc": true,
                "off": -4,
                "pv": "5.69e-06",
                "ev": "9.37e-03",
                "qv": "1.66e-03"
              }, {
                "idx": 30,
                "rc": true,
                "off": -5,
                "pv": "6.14e-06",
                "ev": "1.01e-02",
                "qv": "1.66e-03"
              }, {
                "idx": 44,
                "rc": false,
                "off": 4,
                "pv": "6.98e-06",
                "ev": "1.15e-02",
                "qv": "1.74e-03"
              }, {
                "idx": 48,
                "rc": false,
                "off": -4,
                "pv": "1.03e-05",
                "ev": "1.70e-02",
                "qv": "2.38e-03"
              }, {
                "idx": 43,
                "rc": true,
                "off": -3,
                "pv": "1.49e-05",
                "ev": "2.45e-02",
                "qv": "2.85e-03"
              }, {
                "idx": 53,
                "rc": true,
                "off": -4,
                "pv": "1.68e-05",
                "ev": "2.76e-02",
                "qv": "3.02e-03"
              }, {
                "idx": 38,
                "rc": true,
                "off": -5,
                "pv": "2.26e-05",
                "ev": "3.73e-02",
                "qv": "3.67e-03"
              }, {
                "idx": 41,
                "rc": true,
                "off": -5,
                "pv": "2.26e-05",
                "ev": "3.73e-02",
                "qv": "3.67e-03"
              }, {
                "idx": 50,
                "rc": true,
                "off": -3,
                "pv": "2.92e-05",
                "ev": "4.81e-02",
                "qv": "4.31e-03"
              }, {
                "idx": 28,
                "rc": true,
                "off": -5,
                "pv": "4.07e-05",
                "ev": "6.69e-02",
                "qv": "5.73e-03"
              }, {
                "idx": 39,
                "rc": true,
                "off": -5,
                "pv": "7.24e-05",
                "ev": "1.19e-01",
                "qv": "9.40e-03"
              }, {
                "idx": 37,
                "rc": true,
                "off": -5,
                "pv": "8.08e-05",
                "ev": "1.33e-01",
                "qv": "1.01e-02"
              }, {
                "idx": 46,
                "rc": false,
                "off": 4,
                "pv": "1.29e-04",
                "ev": "2.12e-01",
                "qv": "1.44e-02"
              }, {
                "idx": 27,
                "rc": false,
                "off": -5,
                "pv": "2.54e-04",
                "ev": "4.18e-01",
                "qv": "2.35e-02"
              }, {
                "idx": 35,
                "rc": false,
                "off": -1,
                "pv": "4.96e-04",
                "ev": "8.16e-01",
                "qv": "4.23e-02"
              }, {
                "idx": 32,
                "rc": true,
                "off": -1,
                "pv": "5.27e-04",
                "ev": "8.68e-01",
                "qv": "4.39e-02"
              }, {
                "idx": 18,
                "rc": true,
                "off": -4,
                "pv": "7.63e-04",
                "ev": "1.26e+00",
                "qv": "5.89e-02"
              }, {
                "idx": 72,
                "rc": true,
                "off": -2,
                "pv": "8.80e-04",
                "ev": "1.45e+00",
                "qv": "6.20e-02"
              }, {
                "idx": 13,
                "rc": false,
                "off": -5,
                "pv": "1.13e-03",
                "ev": "1.87e+00",
                "qv": "7.66e-02"
              }, {
                "idx": 57,
                "rc": false,
                "off": -7,
                "pv": "1.23e-03",
                "ev": "2.02e+00",
                "qv": "8.12e-02"
              }, {
                "idx": 67,
                "rc": false,
                "off": -6,
                "pv": "1.43e-03",
                "ev": "2.36e+00",
                "qv": "9.31e-02"
              }, {
                "idx": 1,
                "rc": true,
                "off": -1,
                "pv": "1.49e-03",
                "ev": "2.45e+00",
                "qv": "9.45e-02"
              }, {
                "idx": 34,
                "rc": false,
                "off": -5,
                "pv": "1.81e-03",
                "ev": "2.97e+00",
                "qv": "1.07e-01"
              }, {
                "idx": 8,
                "rc": false,
                "off": -10,
                "pv": "2.79e-03",
                "ev": "4.59e+00",
                "qv": "1.56e-01"
              }, {
                "idx": 7,
                "rc": false,
                "off": -10,
                "pv": "3.07e-03",
                "ev": "5.05e+00",
                "qv": "1.69e-01"
              }, {
                "idx": 73,
                "rc": true,
                "off": -3,
                "pv": "3.20e-03",
                "ev": "5.27e+00",
                "qv": "1.73e-01"
              }, {
                "idx": 64,
                "rc": true,
                "off": -1,
                "pv": "3.39e-03",
                "ev": "5.58e+00",
                "qv": "1.80e-01"
              }, {
                "idx": 70,
                "rc": true,
                "off": 2,
                "pv": "3.98e-03",
                "ev": "6.55e+00",
                "qv": "2.05e-01"
              }, {
                "idx": 42,
                "rc": true,
                "off": -2,
                "pv": "4.93e-03",
                "ev": "8.12e+00",
                "qv": "2.50e-01"
              }, {
                "idx": 10,
                "rc": false,
                "off": -10,
                "pv": "5.13e-03",
                "ev": "8.45e+00",
                "qv": "2.56e-01"
              }, {
                "idx": 12,
                "rc": true,
                "off": -3,
                "pv": "5.26e-03",
                "ev": "8.66e+00",
                "qv": "2.59e-01"
              }, {
                "idx": 71,
                "rc": true,
                "off": -3,
                "pv": "5.50e-03",
                "ev": "9.06e+00",
                "qv": "2.66e-01"
              }, {
                "idx": 5,
                "rc": true,
                "off": -8,
                "pv": "5.79e-03",
                "ev": "9.52e+00",
                "qv": "2.76e-01"
              }, {
                "idx": 20,
                "rc": true,
                "off": -3,
                "pv": "6.15e-03",
                "ev": "1.01e+01",
                "qv": "2.85e-01"
              }, {
                "idx": 62,
                "rc": true,
                "off": -1,
                "pv": "6.51e-03",
                "ev": "1.07e+01",
                "qv": "2.97e-01"
              }, {
                "idx": 2,
                "rc": true,
                "off": 1,
                "pv": "6.93e-03",
                "ev": "1.14e+01",
                "qv": "3.10e-01"
              }, {
                "idx": 68,
                "rc": false,
                "off": 0,
                "pv": "6.96e-03",
                "ev": "1.15e+01",
                "qv": "3.10e-01"
              }, {
                "idx": 19,
                "rc": true,
                "off": -4,
                "pv": "7.26e-03",
                "ev": "1.20e+01",
                "qv": "3.18e-01"
              }, {
                "idx": 21,
                "rc": true,
                "off": -4,
                "pv": "7.54e-03",
                "ev": "1.24e+01",
                "qv": "3.26e-01"
              }, {
                "idx": 59,
                "rc": false,
                "off": 1,
                "pv": "7.89e-03",
                "ev": "1.30e+01",
                "qv": "3.37e-01"
              }, {
                "idx": 66,
                "rc": false,
                "off": 4,
                "pv": "8.04e-03",
                "ev": "1.32e+01",
                "qv": "3.39e-01"
              }, {
                "idx": 31,
                "rc": true,
                "off": -1,
                "pv": "8.34e-03",
                "ev": "1.37e+01",
                "qv": "3.41e-01"
              }, {
                "idx": 69,
                "rc": true,
                "off": -4,
                "pv": "8.37e-03",
                "ev": "1.38e+01",
                "qv": "3.41e-01"
              }, {
                "idx": 3,
                "rc": true,
                "off": -5,
                "pv": "8.41e-03",
                "ev": "1.38e+01",
                "qv": "3.41e-01"
              }, {
                "idx": 15,
                "rc": true,
                "off": -2,
                "pv": "9.54e-03",
                "ev": "1.57e+01",
                "qv": "3.82e-01"
              }, {
                "idx": 58,
                "rc": false,
                "off": -3,
                "pv": "1.18e-02",
                "ev": "1.95e+01",
                "qv": "4.57e-01"
              }, {
                "idx": 63,
                "rc": true,
                "off": -5,
                "pv": "1.18e-02",
                "ev": "1.95e+01",
                "qv": "4.57e-01"
              }, {
                "idx": 9,
                "rc": true,
                "off": -10,
                "pv": "1.23e-02",
                "ev": "2.02e+01",
                "qv": "4.69e-01"
              }, {
                "idx": 11,
                "rc": true,
                "off": 0,
                "pv": "1.33e-02",
                "ev": "2.18e+01",
                "qv": "4.92e-01"
              }, {
                "idx": 65,
                "rc": true,
                "off": -2,
                "pv": "1.33e-02",
                "ev": "2.18e+01",
                "qv": "4.92e-01"
              }, {
                "idx": 25,
                "rc": true,
                "off": -1,
                "pv": "1.33e-02",
                "ev": "2.19e+01",
                "qv": "4.92e-01"
              }
            ]
          }, {
            "idx": 1,
            "matches": [
              {
                "idx": 60,
                "rc": false,
                "off": -3,
                "pv": "2.92e-04",
                "ev": "4.81e-01",
                "qv": "4.14e-01"
              }, {
                "idx": 54,
                "rc": false,
                "off": 0,
                "pv": "4.52e-04",
                "ev": "7.44e-01",
                "qv": "4.14e-01"
              }, {
                "idx": 24,
                "rc": false,
                "off": -4,
                "pv": "4.92e-04",
                "ev": "8.10e-01",
                "qv": "4.14e-01"
              }, {
                "idx": 16,
                "rc": false,
                "off": -3,
                "pv": "5.90e-04",
                "ev": "9.70e-01",
                "qv": "4.14e-01"
              }, {
                "idx": 22,
                "rc": false,
                "off": -5,
                "pv": "6.31e-04",
                "ev": "1.04e+00",
                "qv": "4.14e-01"
              }, {
                "idx": 61,
                "rc": false,
                "off": -2,
                "pv": "8.92e-04",
                "ev": "1.47e+00",
                "qv": "4.67e-01"
              }, {
                "idx": 14,
                "rc": true,
                "off": -2,
                "pv": "1.11e-03",
                "ev": "1.83e+00",
                "qv": "4.67e-01"
              }, {
                "idx": 4,
                "rc": false,
                "off": -5,
                "pv": "1.38e-03",
                "ev": "2.27e+00",
                "qv": "4.67e-01"
              }, {
                "idx": 17,
                "rc": false,
                "off": 0,
                "pv": "1.57e-03",
                "ev": "2.58e+00",
                "qv": "4.67e-01"
              }, {
                "idx": 6,
                "rc": false,
                "off": -2,
                "pv": "1.63e-03",
                "ev": "2.68e+00",
                "qv": "4.67e-01"
              }, {
                "idx": 0,
                "rc": false,
                "off": -5,
                "pv": "1.68e-03",
                "ev": "2.76e+00",
                "qv": "4.67e-01"
              }, {
                "idx": 55,
                "rc": false,
                "off": 0,
                "pv": "1.77e-03",
                "ev": "2.92e+00",
                "qv": "4.67e-01"
              }, {
                "idx": 23,
                "rc": false,
                "off": -5,
                "pv": "1.85e-03",
                "ev": "3.05e+00",
                "qv": "4.67e-01"
              }
            ]
          }
        ],
        "runtime": {
          "host": "192.168.2.3",
          "when": "Thu Mar 31 20:26:05 2022",
          "cycles": 11154799,
          "seconds": 11.155
        }
      };
    </script>
    <script>
var site_url = "http://meme-suite.org";
</script>
    <script>
/*
 * $
 *
 * Shorthand function for getElementById
 */
function $(el) {
  return document.getElementById(el);
}


/*
 * See http://stackoverflow.com/a/5450113/66387
 * Does string multiplication like the perl x operator.
 */
function string_mult(pattern, count) {
    if (count < 1) return '';
    var result = '';
    while (count > 1) {
        if (count & 1) result += pattern;
        count >>= 1, pattern += pattern;
    }
    return result + pattern;
}

/*
 * See http://stackoverflow.com/questions/814613/how-to-read-get-data-from-a-url-using-javascript
 * Slightly modified with information from
 * https://developer.mozilla.org/en/DOM/window.location
 */
function parse_params() {
  "use strict";
  var search, queryStart, queryEnd, query, params, nvPairs, i, nv, n, v;
  search = window.location.search;
  queryStart = search.indexOf("?") + 1;
  queryEnd   = search.indexOf("#") + 1 || search.length + 1;
  query      = search.slice(queryStart, queryEnd - 1);

  if (query === search || query === "") return {};

  params  = {};
  nvPairs = query.replace(/\+/g, " ").split("&");

  for (i = 0; i < nvPairs.length; i++) {
    nv = nvPairs[i].split("=");
    n  = decodeURIComponent(nv[0]);
    v  = decodeURIComponent(nv[1]);
    // allow a name to be used multiple times
    // storing each value in the array
    if (!(n in params)) {
      params[n] = [];
    }
    params[n].push(nv.length === 2 ? v : null);
  }
  return params;
}

/*
 * coords
 *
 * Calculates the x and y offset of an element.
 * From http://www.quirksmode.org/js/findpos.html
 * with alterations to take into account scrolling regions
 */
function coords(elem) {
  var myX = myY = 0;
  if (elem.getBoundingClientRect) {
    var rect;
    rect = elem.getBoundingClientRect();
    myX = rect.left + ((typeof window.pageXOffset !== "undefined") ?
        window.pageXOffset : document.body.scrollLeft);
    myY = rect.top + ((typeof window.pageYOffset !== "undefined") ?
        window.pageYOffset : document.body.scrollTop);
  } else {
    // this fall back doesn't properly handle absolutely positioned elements
    // inside a scrollable box
    var node;
    if (elem.offsetParent) {
      // subtract all scrolling
      node = elem;
      do {
        myX -= node.scrollLeft ? node.scrollLeft : 0;
        myY -= node.scrollTop ? node.scrollTop : 0;
      } while (node = node.parentNode);
      // this will include the page scrolling (which is unwanted) so add it back on
      myX += (typeof window.pageXOffset !== "undefined") ? window.pageXOffset : document.body.scrollLeft;
      myY += (typeof window.pageYOffset !== "undefined") ? window.pageYOffset : document.body.scrollTop;
      // sum up offsets
      node = elem;
      do {
        myX += node.offsetLeft;
        myY += node.offsetTop;
      } while (node = node.offsetParent);
    }
  }
  return [myX, myY];
}

/*
 * position_popup
 *
 * Positions a popup relative to an anchor element.
 *
 * The available positions are:
 * 0 - Centered below the anchor.
 */
function position_popup(anchor, popup, position) {
  "use strict";
  var a_x, a_y, a_w, a_h, p_x, p_y, p_w, p_h;
  var a_xy, spacer, margin, scrollbar, page_w;
  // define constants
  spacer = 5;
  margin = 15;
  scrollbar = 15;
  // define the positions and widths
  a_xy = coords(anchor);
  a_x = a_xy[0];
  a_y = a_xy[1];
  a_w = anchor.offsetWidth;
  a_h = anchor.offsetHeight;
  p_w = popup.offsetWidth;
  p_h = popup.offsetHeight;
  page_w = null;
  if (window.innerWidth) {
    page_w = window.innerWidth;
  } else if (document.body) {
    page_w = document.body.clientWidth;
  }
  // check the position type is defined
  if (typeof position !== "number") {
    position = 0;
  }
  // calculate the popup position
  switch (position) {
    case 1:
      p_x = a_x + a_w + spacer;
      p_y = a_y + (a_h / 2) - (p_h / 2);
      break;
    case 0:
    default:
      p_x = a_x + (a_w / 2) - (p_w / 2);
      p_y = a_y + a_h + spacer;
      break;
  }
  // constrain the popup position
  if (p_x < margin) {
    p_x = margin;
  } else if (page_w != null && (p_x + p_w) > (page_w - margin - scrollbar)) {
    p_x = page_w - margin - scrollbar - p_w;
  }
  if (p_y < margin) {
    p_y = margin;
  }
  // position the popup
  popup.style.left = p_x + "px";
  popup.style.top = p_y + "px";
}

function lookup_help_popup(popup_id) {
  var _body, pop, info;
  pop = document.getElementById(popup_id);
  if (pop == null) {
    _body = document.getElementsByTagName("body")[0];
    pop = document.createElement("div");
    pop.className = "pop_content";
    pop.id = popup_id;
    pop.style.backgroundColor = "#FFC";
    pop.style.borderColor = "black";
    info = document.createElement("p");
    info.style.fontWeight = "bold";
    info.appendChild(document.createTextNode("Error: No popup for topic \"" + popup_id + "\"."));
    pop.appendChild(info);
    // this might cause problems with the menu, but as this only happens
    // when something is already wrong I don't think that's too much of a problem
    _body.insertBefore(pop, _body.firstChild);
  }
  if (document.getElementsByTagName('body')[0].hasAttribute("data-autobtns")) {
    if (!/\bauto_buttons\b/.test(pop.className)) {
      pop.className += " auto_buttons";
      var back_btn_sec = document.createElement("div");
      back_btn_sec.className = "nested_only pop_back_sec";
      var back_btn = document.createElement("span");
      back_btn.className = "pop_back";
      back_btn.appendChild(document.createTextNode("<< back"));
      back_btn.addEventListener("click", function(e) {
        help_return();
      }, false);
      back_btn_sec.appendChild(back_btn);
      pop.insertBefore(back_btn_sec, pop.firstChild);
      var close_btn_sec = document.createElement("div");
      close_btn_sec.className = "pop_close_sec";
      var close_btn = document.createElement("span");
      close_btn.className = "pop_close";
      close_btn.appendChild(document.createTextNode("close"));
      close_btn.addEventListener("click", function(e) {
        help_popup();
      }, false);
      close_btn_sec.appendChild(close_btn);
      pop.appendChild(close_btn_sec);
    }
  }
  return pop;
}

/*
 * help_popup
 *
 * Moves around help pop-ups so they appear
 * below an activator.
 */
function help_popup(activator, popup_id) {
  "use strict";
  var pop;
  // set default values
  if (typeof help_popup.popup === "undefined") {
    help_popup.popup = [];
  }
  if (typeof help_popup.activator === "undefined") {
    help_popup.activator = null;
  }
  var last_pop = (help_popup.popup.length > 0 ? help_popup.popup[help_popup.popup.length - 1] : null);
  if (typeof(activator) == "undefined") { // no activator so hide
    if (last_pop != null) {
      last_pop.style.display = 'none';
      help_popup.popup = [];
    }
    return;
  }
  pop = lookup_help_popup(popup_id);
  if (pop == last_pop) {
    if (activator == help_popup.activator) {
      //hide popup (as we've already shown it for the current help button)
      last_pop.style.display = 'none';
      help_popup.popup = [];
      return; // toggling complete!
    }
  } else if (last_pop != null) {
    //activating different popup so hide current one
    last_pop.style.display = 'none';
  }
  help_popup.popup = [pop];
  help_popup.activator = activator;
  toggle_class(pop, "nested", false);
  //must make the popup visible to measure it or it has zero width
  pop.style.display = 'block';
  position_popup(activator, pop);
}

/*
 * help_refine
 * 
 * Intended for links within a help popup. Stores a stack of state so
 * you can go back.
 */
function help_refine(popup_id) {
  if (help_popup.popup == null || help_popup.popup.length == 0 || help_popup.activator == null) {
    //throw new Error("Cannot refine a help popup when one is not shown!");
    var pop = lookup_help_popup(popup_id);
    var act_id = popup_id + '_act';
    var activator = document.getElementById(act_id);
    help_popup(activator, popup_id);
  }
  var pop = lookup_help_popup(popup_id);
  var last_pop = help_popup.popup[help_popup.popup.length - 1];
  if (pop == last_pop) return; // slightly odd, but no real cause for alarm
  help_popup.popup.push(pop);
  toggle_class(pop, "nested", true);
  last_pop.style.display = "none";
  //must make the popup visible to measure it or it has zero width
  pop.style.display = "block";
  position_popup(help_popup.activator, pop);
}

/*
 * help_return
 * 
 * Intended for links within a help popup. Stores a stack of state so
 * you can go back.
 */
function help_return() {
  if (help_popup.popup == null || help_popup.popup.length == 0 || help_popup.activator == null) {
    throw new Error("Can not return to a earlier help popup when one is not shown!");
  }
  var last_pop = help_popup.popup.pop();
  last_pop.style.display = "none";
  var pop = (help_popup.popup.length > 0 ? help_popup.popup[help_popup.popup.length - 1] : null);
  if (pop != null) {
    toggle_class(pop, "nested", help_popup.popup.length > 1);
    pop.style.display = "block";
    position_popup(help_popup.activator, pop);
  } else {
    help_popup.activator = null;
  }
}

/*
 * update_scroll_pad
 *
 * Creates padding at the bottom of the page to allow
 * scrolling of anything into view.
 */
function update_scroll_pad() {
  var page, pad;
  page = (document.compatMode === "CSS1Compat") ? document.documentElement : document.body;
  pad = $("scrollpad");
  if (pad === null) {
    pad = document.createElement("div");
    pad.id = 'scrollpad';
    document.getElementsByTagName('body')[0].appendChild(pad);
  }
  pad.style.height = Math.abs(page.clientHeight - 100) + "px";
}

function substitute_classes(node, remove, add) {
  "use strict";
  var list, all, i, cls, classes;
  list = node.className.split(/\s+/);
  all = {};
  for (i = 0; i < list.length; i++) {
    if (list[i].length > 0) all[list[i]] = true;
  }
  for (i = 0; i < remove.length; i++) {
    if (all.hasOwnProperty(remove[i])) {
      delete all[remove[i]];
    }
  }
  for (i = 0; i < add.length; i++) {
    all[add[i]] = true;
  }
  classes = "";
  for (cls in all) {
    classes += cls + " ";
  }
  node.className = classes;
}

/*
 * toggle_class
 *
 * Adds or removes a class from the node. If the parameter 'enabled' is not 
 * passed then the existence of the class will be toggled, otherwise it will be
 * included if enabled is true.
 */
function toggle_class(node, cls, enabled) {
  var classes = node.className;
  var list = classes.replace(/^\s+/, '').replace(/\s+$/, '').split(/\s+/);
  var found = false;
  for (var i = 0; i < list.length; i++) {
    if (list[i] == cls) {
      list.splice(i, 1);
      i--;
      found = true;
    }
  }
  if (typeof enabled == "undefined") {
    if (!found) list.push(cls);
  } else {
    if (enabled) list.push(cls);
  }
  node.className = list.join(" ");
}

/*
 * find_child
 *
 * Searches child nodes in depth first order and returns the first it finds
 * with the className specified.
 * TODO replace with querySelector
 */
function find_child(node, className) {
  var pattern;
  if (node == null || typeof node !== "object") {
    return null;
  }
  if (typeof className === "string") {
    pattern = new RegExp("\\b" + className + "\\b");
  } else {
    pattern = className;
  }
  if (node.nodeType == Node.ELEMENT_NODE && 
      pattern.test(node.className)) {
    return node;
  } else {
    var result = null;
    for (var i = 0; i < node.childNodes.length; i++) {
      result = find_child(node.childNodes[i], pattern);
      if (result != null) break;
    }
    return result;
  }
}

/*
 * find_parent
 *
 * Searches parent nodes outwards from the node and returns the first it finds
 * with the className specified.
 */
function find_parent(node, className) {
  var pattern;
  pattern = new RegExp("\\b" + className + "\\b");
  do {
    if (node.nodeType == Node.ELEMENT_NODE && 
        pattern.test(node.className)) {
      return node;
    }
  } while (node = node.parentNode);
  return null;
}

/*
 * find_parent_tag
 *
 * Searches parent nodes outwards from the node and returns the first it finds
 * with the tag name specified. HTML tags should be specified in upper case.
 */
function find_parent_tag(node, tag_name) {
  do {
    if (node.nodeType == Node.ELEMENT_NODE && node.tagName == tag_name) {
      return node;
    }
  } while (node = node.parentNode);
  return null;
}

/*
 * __toggle_help
 *
 * Uses the 'topic' property of the this object to
 * toggle display of a help topic.
 *
 * This function is not intended to be called directly.
 */
function __toggle_help(e) {
  if (!e) e = window.event;
  if (e.type === "keydown") {
    if (e.keyCode !== 13 && e.keyCode !== 32) {
      return;
    }
    // stop a submit or something like that
    e.preventDefault();
  }

  help_popup(this, this.getAttribute("data-topic"));
}

function setup_help_button(button) {
  "use strict";
  var topic;
  if (button.hasAttribute("data-topic")) {
    topic = button.getAttribute("data-topic");
    if (document.getElementById(topic) != null) {
      button.tabIndex = "0"; // make keyboard selectable
      button.addEventListener("click", function() {
        help_popup(button, topic);
      }, false);
      button.addEventListener("keydown", function(e) {
        // toggle only on Enter or Spacebar, let other keys do their thing
        if (e.keyCode !== 13 && e.keyCode !== 32) return;
        // stop a submit or something like that
        e.preventDefault();
        help_popup(button, topic);
      }, false);
    } else {
      button.style.visibility = "hidden";
    }
  }
  button.className += " active";
}

/*
 * help_button
 *
 * Makes a help button for the passed topic.
 */
function help_button(topic) {
  var btn = document.createElement("div");
  btn.className = "help";
  btn.setAttribute("data-topic", topic);
  setup_help_button(btn);
  return btn;
}

/*
 * prepare_download
 *
 * Sets the attributes of a link to setup a file download using the given content.
 * If no link is provided then create one and click it.
 */
function prepare_download(content, mimetype, filename, link) {
  "use strict";
  // if no link is provided then create one and click it
  var click_link = false;
  if (!link) {
    link = document.createElement("a");
    click_link = true;
  }
  try {
    // Use a BLOB to convert the text into a data URL.
    // We could do this manually with a base 64 conversion.
    // This will only be supported on modern browsers,
    // hence the try block.
    var blob = new Blob([content], {type: mimetype});
    var reader = new FileReader();
    reader.onloadend = function() {
      // If we're lucky the browser will also support the download
      // attribute which will let us suggest a file name to save the link.
      // Otherwise it is likely that the filename will be unintelligible. 
      link.setAttribute("download", filename);
      link.href = reader.result;
      if (click_link) {
        // must add the link to click it
        document.body.appendChild(link);
        link.click();
        document.body.removeChild(link);
      }
    }
    reader.readAsDataURL(blob);
  } catch (error) {
    if (console && console.log) console.log(error);
    // probably an old browser
    link.href = "";
    link.visible = false;
  }
}

/*
 * add_cell
 *
 * Add a cell to the table row.
 */
function add_cell(row, node, cls, click_action) {
  var cell = row.insertCell(row.cells.length);
  if (node) cell.appendChild(node);
  if (cls && cls !== "") cell.className = cls;
  if (click_action) cell.addEventListener("click", click_action, false);
}

/*
 * add_header_cell
 *
 * Add a header cell to the table row.
 */
function add_header_cell(row, node, help_topic, cls, colspan) {
  var th = document.createElement("th");
  if (node) th.appendChild(node);
  if (help_topic && help_topic !== "") th.appendChild(help_button(help_topic));
  if (cls && cls !== "") th.className = cls;
  if (typeof colspan == "number" && colspan > 1) th.colSpan = colspan;
  row.appendChild(th);
}

/*
 * add_text_cell
 *
 * Add a text cell to the table row.
 */
function add_text_cell(row, text, cls, action) {
  var node = null;
  if (typeof(text) != 'undefined') node = document.createTextNode(text);
  add_cell(row, node, cls, action);
}

/*
 * add_text_header_cell
 *
 * Add a text header cell to the table row.
 */
function add_text_header_cell(row, text, help_topic, cls, action, colspan) {
  var node = null;
  if (typeof(text) != 'undefined') {
    var nbsp = (help_topic ? "\u00A0" : "");
    var str = "" + text;
    var parts = str.split(/\n/);
    if (parts.length === 1) {
      if (action) {
        node = document.createElement("span");
        node.appendChild(document.createTextNode(str + nbsp));
      } else {
        node = document.createTextNode(str + nbsp);
      }
    } else {
      node = document.createElement("span");
      for (var i = 0; i < parts.length; i++) {
        if (i !== 0) {
          node.appendChild(document.createElement("br"));
        }
        node.appendChild(document.createTextNode(parts[i]));
      }
    }
    if (action) {
      node.addEventListener("click", action, false);
      node.style.cursor = "pointer";
    }
  }
  add_header_cell(row, node, help_topic, cls, colspan);
}

function setup_help() {
  "use strict";
  var help_buttons, i;
  help_buttons = document.querySelectorAll(".help:not(.active)");
  for (i = 0; i < help_buttons.length; i++) {
    setup_help_button(help_buttons[i]);
  }
}

function setup_scrollpad() {
  "use strict";
  if (document.getElementsByTagName('body')[0].hasAttribute("data-scrollpad") && document.getElementById("scrollpad") == null) {
    window.addEventListener("resize", update_scroll_pad, false);
    update_scroll_pad();
  }
}

// anon function to avoid polluting global scope
(function() {
  "use strict";
  window.addEventListener("load", function load(evt) {
    window.removeEventListener("load", load, false);
    setup_help();
    setup_scrollpad();
  }, false);
})();

/*
 *  make_link
 *
 *  Creates a text node and if a URL is specified it surrounds it with a link.
 *  If the URL doesn't begin with "http://" it automatically adds it, as
 *  relative links don't make much sense in this context.
 */
function make_link(text, url) {
  var textNode = null;
  var link = null;
  if (typeof text !== "undefined" && text !== null) textNode = document.createTextNode(text);
  if (typeof url === "string") {
    if (url.indexOf("//") == -1) {
      url = "http://" + url;
    }
    link = document.createElement('a');
    link.href = url;
    if (textNode) link.appendChild(textNode);
    return link;
  }
  return textNode;
}

//
// Function to create an HTML paragraph describing the 
// MEME Suite background model source.
//
function make_background_source(title, source, text) {
  var paraNode = document.createElement("P");
  var titleNode = document.createElement("B");
  var textNode1 = document.createTextNode("\u00A0\u00A0\u00A0\u00A0" + title + ": ");
  titleNode.appendChild(textNode1);
  var source_text = ((source == "--motif--") ? "the (first) motif file" : (source == "--nrdb--") ? "an old version of the NCBI non-redundant database" : (source == "--uniform--") ? "the uniform model" : (source == "--query--") ? "the query file" : (source == "--sequences--") ? "built from the (primary) sequences" : ("the file '" + source + "'"));
  if (text) { return source_text; }
  var textNode2 = document.createTextNode(source_text);
  paraNode.appendChild(titleNode);
  paraNode.appendChild(textNode2);
  return paraNode;
}

// Function to create a help button
function make_help_button(container, help_topic) {
  container.appendChild(help_button(help_topic));
}
</script>
    <script>
//
// simple-shared-doc.js
//
// Function to replace the innerHTML of element "id" with the HTML indicated by "doc_type".
// Easier to read and update than the more flexible approach in shared-doc.js. 
//
function print_doc(id, doc_type) {
  var html;
  switch (doc_type) {
    case 'motif-consensus':
      html = `
	<p id="consensus_doc"> 
	   A <b>consensus sequence</b> is constructed from each column in a
	   motif's frequency matrix using the <b>"50% rule"</b>
	   as follows:
	</p>
	<ol>
	  <li>The letter frequencies in the column are sorted in decreasing order.</li>
	  <li>Letters with frequency less 50% of the maximum are discarded.</li>
	  <li>The letter used in this position in the consensus sequence is determined
	  by the first rule below that applies:</li>
	  <ul>
	    <li>If there is only one letter left, or if the remaining letters exactly match
	    an ambiguous symbol in the alphabet, the <b>letter</b> or <b>ambiguous symbol</b>,
	    respectively, is used.</li>
	    <li>Otherwise, if the remaining set contains at least 50% of the core
	    symbols in the alphabet, the alphabet's <b>wildcard</b>
	    (e.g., "N" for DNA or RNA, and "X" for protein) is used.</li>
	    <li>Otherwise, the letter with the <b>maximum frequency</b> is used.</li>
	  </ul>
	</ol>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'ame-results-header':
      html = `
	<p>
          AME outputs a tab-separated values (TSV) file ('ame.tsv') that contains one line for each motif
	  found to be significantly enriched.
	  The lines are sorted in order of decreasing statistical significance.
          The first line contains the (tab-separated) names of the fields.
	  Your command line is given at the end of the file in a comment line starting with the
	  character '#'.
	</p>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'ame-results-table':
      html = `
	<p>
	  The <a href="` + site_url + `/doc/ame-output-format.html#tsv_results">AME Results TSV Format</a> 
	  differs depending on the choice of method for measuring motif enrichment, as shown in the following table. 
	</p>
	<table style="width:100%" border=1>
	  <tr>
	    <th>Method</th>
	    <th colspan=19>Output Columns</th>
	  </tr>
	  <tr>
	    <th></th> 
	    <th>1</th>
	    <th>2</th>
	    <th>3</th>
	    <th>4</th>
	    <th>5</th>
	    <th>6</th>
	    <th>7</th>
	    <th>8</th>
	    <th>9</th>
	    <th>10</th>
	    <th>11</th>
	    <th>12</th>
	    <th>13 </th>
	    <th>14 </th>
	    <th>15 </th>
	    <th>16 </th>
	    <th>17 </th>
	    <th>18 </th>
	    <th>19 </th>
	  </tr>
	  <tr>
	    <td>fisher</td>
	    <td>rank </td>
	    <td>motif_DB </td>
	    <td>motif_ID </td>
	    <td>motif_alt_ID </td>
	    <td>consensus </td>
	    <td>p-value </td>
	    <td>adj_p-value </td>
	    <td>E-value</td>
	    <td>tests </td>
	    <td>FASTA_max </td>
	    <td>pos </td>
	    <td>neg </td>
	    <td>PWM_min</td>
	    <td>TP </td>
	    <td>%TP </td>
	    <td>FP </td>
	    <td>%FP </td>
	    </td> <td>
	    </td> <td>
	  </tr>
	  <tr>
	    <td>ranksum</td>
	    <td>rank </td>
	    <td>motif_DB </td>
	    <td>motif_ID </td>
	    <td>motif_alt_ID </td>
	    <td>consensus </td>
	    <td>p-value </td>
	    <td>adj_p-value </td>
	    <td>E-value</td>
	    <td>tests </td>
	    <td>FASTA_max </td>
	    <td>pos </td>
	    <td>neg</td>
	    <td>U </td>
	    <td>pleft </td>
	    <td>pright </td>
	    <td>pboth </td>
	    <td>adj_pleft </td>
	    <td>adj_pright </td>
	    <td>adj_both</td>
	  </tr>
	  <tr>
	    <td>3dmhg</td>
	    <td>rank </td>
	    <td>motif_DB </td>
	    <td>motif_ID </td>
	    <td>motif_alt_ID </td>
	    <td>consensus </td>
	    <td>p-value </td>
	    <td>adj_p-value </td>
	    <td>E-value</td>
	    <td>tests </td>
	    <td>FASTA_max </td>
	    <td>pos </td>
	    <td>neg</td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	  </tr>
	  <tr>
	    <td>4dmhg</td>
	    <td>rank </td>
	    <td>motif_DB </td>
	    <td>motif_ID </td>
	    <td>motif_alt_ID </td>
	    <td>consensus </td>
	    <td>p-value </td>
	    <td>adj_p-value </td>
	    <td>E-value</td>
	    <td>tests </td>
	    <td>FASTA_max </td>
	    <td>pos </td>
	    <td>neg</td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	  </tr>
	  <tr>
	    <td>pearson</td>
	    <td>rank </td>
	    <td>motif_DB </td>
	    <td>motif_ID </td>
	    <td>motif_alt_ID </td>
	    <td>consensus </td>
	    <td>p-value </td>
	    <td>adj_p-value </td>
	    <td>E-value</td>
	    <td>tests </td>
	    <td>Pearson_CC </td>
	    <td>mean_squared_error </td>
	    <td>slope </td>
	    <td>intercept</td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	  </tr>
	  <tr>
	    <td>spearman</td>
	    <td>rank </td>
	    <td>motif_DB </td>
	    <td>motif_ID </td>
	    <td>motif_alt_ID </td>
	    <td>consensus </td>
	    <td>p-value </td>
	    <td>adj_p-value </td>
	    <td>E-value</td>
	    <td>tests </td>
	    <td>Spearman_CC</td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	    </td> <td>
	  </tr>
        </table>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'ame-results-description':
      html = `
        <p>
          The names and meanings of each of the fields in <a href="` + site_url + `/doc/ame-output-format.html#tsv_results">AME Results TSV Format</a>,
          which depend on the method of enrichment analysis you chose, are described below.
        </p>
        <table class="dark" style="width:100%" border=1>
	  <tr> <th>method</th> <th>field</th> <th>name</th> <th>contents</th> </tr>	
    	  <tr> <td>all</td> <td>1</td> <td>rank</td> <td>The rank of the significance of the motif in the sorted results.</td> </tr>
    	  <tr> <td>all</td> <td>2</td> <td>motif_DB</td> <td> ` + get_doc_text('motif-db', 'the motif.') + `</td> </tr>
    	  <tr> <td>all</td> <td>3</td> <td>motif_ID</td> <td> ` + get_doc_text('motif-id') + `</td> </tr>
    	  <tr> <td>all</td> <td>4</td> <td>motif_alt_ID</td> <td> ` + get_doc_text('motif-alt-id') + `</td> </tr>
    	  <tr> <td>all</td> <td>5</td> <td>consensus</td> <td> ` + get_doc_text('motif-cons') + `</td> </tr>
    	  <tr> <td>all</td> <td>6</td> <td>p-value</td> <td> ` + get_doc_text('ame-pvalue') + `</td> </tr>
    	  <tr> <td>all</td> <td>7</td> <td>adj_p-value</td> <td> ` + get_doc_text('ame-adj-pvalue') + `</td> </tr>
    	  <tr> <td>all</td> <td>8</td> <td>E-value</td> <td> ` + get_doc_text('ame-evalue') + `</td> </tr>
    	  <tr> <td>all</td> <td>9</td> <td>tests</td> <td>The number of tests performed; used in correcting the <i>p</i>-value</td> </tr>
	  <tr> <td colspan=4></td>
          <tr> <td>fisher, ranksum, 3dmhg, 4dmhg</td> <td>10</td> <td>FASTA_max</td> <td>The optimal threshold for <b>labeling</b> sequences as positive;
            sequences with FASTA score less than or equal to the threshold are labeled as positive;
            this field will be contain the number of primary sequences if you provided
            a control file (using option <code>--control</code>); this field will contain the size of the
            partition if you specified one (using option <code>--fix-partition</code>).</td> </tr>
          <tr> <td>fisher, ranksum, 3dmhg, 4dmhg</td> <td>11</td> <td>pos</td> <td>The number of sequences <b>labeled</b> as positive.</td> </tr>
          <tr> <td>fisher, ranksum, 3dmhg, 4dmhg</td> <td>12</td> <td>neg</td> <td>The number of sequences <b>labeled</b> as negative.</td> </tr>
	  <tr> <td colspan=4></td>
          <tr> <td>fisher</td> <td>13</td> <td>PWM_min</td> <td>The optimal threshold on PWM score for <b>classifying</b> sequences as positive;
                sequences with PWM score greater than or equal to the threshold are classified as positive.</td> </tr>
          <tr> <td>fisher</td> <td>14</td> <td>TP</td> <td>The number of true positive sequences: sequences both <b>labeled</b> and <b>classified</b> as positive</td> </tr>
          <tr> <td>fisher</td> <td>15</td> <td>%TP</td> <td>The percentage of true positive sequences: percentage of sequences <b>labeled</b> positive and <b>classified</b> as positive.</td> </tr>
          <tr> <td>fisher</td> <td>16</td> <td>FP</td> <td>The number of false positive sequences: sequences <b>labeled</b> negative but <b>classified</b> as positive.</td> </tr>
          <tr> <td>fisher</td> <td>17</td> <td>%TP</td> <td>The percentage of false positive sequences: sequences <b>labeled</b> negative but <b>classified</b> as positive.</td> </tr>
	  <tr> <td colspan=4></td>
          <tr> <td>ranksum</td> <td>13</td> <td>U</td> <td>The value of the Mann-Whitney <i>U</i> statistic.</td> </tr>
          <tr> <td>ranksum</td> <td>14</td> <td>pleft</td> <td>The left-tailed <i>p</i>-value of the rank-sum test.</td> </tr>
          <tr> <td>ranksum</td> <td>15</td> <td>pright</td> <td>The right-tailed <i>p</i>-value of the rank-sum test.</td> </tr>
          <tr> <td>ranksum</td> <td>16</td> <td>pboth</td> <td>The two-tailed <i>p</i>-value of the rank-sum test.</td> </tr>
          <tr> <td>ranksum</td> <td>17</td> <td>adj_pleft</td> <td>The left-tailed <i>p</i>-value of the rank-sum test, adjusted for multiple tests.</td> </tr>
          <tr> <td>ranksum</td> <td>18</td> <td>adj_pright</td> <td>The right-tailed <i>p</i>-value of the rank-sum test, adjusted for multiple tests.</td> </tr>
          <tr> <td>ranksum</td> <td>19</td> <td>adj_both</td> <td>The two-tailed <i>p</i>-value of the rank-sum test, adjusted for multiple tests.</td> </tr>
	  <tr> <td colspan=4></td>
	  <tr> <td>pearson</td> <td>10</td> <td>Pearson_CC</td> <td>The correlation coefficient of the PWM and FASTA scores of positive sequences.</td> </tr>
	  <tr> <td>pearson</td> <td>11</td> <td>mean_squared_error</td> <td>The mean-squared error of the regression line between PWM and FASTA scores.</td> </tr>
	  <tr> <td>pearson</td> <td>12</td> <td>slope</td> <td>The slope of the regression line.</td> </tr>
	  <tr> <td>pearson</td> <td>13</td> <td>intercept</td> <td>The y-intercept of the regression line.</td> </tr>
	  <tr> <td colspan=4></td>
	  <tr> <td>spearman</td> <td>10</td> <td>Spearman_CC</td> <td>The correlation coefficient of the PWM and FASTA ranks of positive sequences./td> </tr>
        </table>
	  </ul>
	</p>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'ame-sequences-tsv':
      html = `
        <p>AME outputs a tab-separated values (TSV) file ('sequences.tsv') containing one line for
	each sequence classified as 'positive' by AME for each significant motif.
        The first line contains the (tab-separated) names of the fields.
	The lines are grouped by motif, and groups are separated by a line
	starting with the character "#".
        </p>
        <p>
          The names and meanings of each of the fields in <a href="` + site_url + `/doc/ame-output-format.html#tsv_sequences">AME Significant Sequences TSV Format</a>,
          are described below.
        </p>
        <table class="dark" style="width:100%" border=1>
          <tr> <th>field</th> <th>name</th> <th>contents</th> </tr>
	  <tr> <td>1</td> <td>motif_DB</td> <td>` + get_doc_text('motif-db', 'the motif.') + `</td> </tr>
	  <tr> <td>2</td> <td>motif_ID</td> <td>the ID of the motif</td> </tr>
	  <tr> <td>3</td> <td>seq_ID</td> <td>the ID of the sequence</td> </tr>
	  <tr> <td>4</td> <td><i>label_score</i> (either FASTA_score or PWM_score)</td> <td>the value of the score used to label it as positive</td> </tr>
	  <tr> <td>5</td> <td><i>class_score</i> (either PWM_score or FASTA_score)</td> <td>the value of the score used to classify it as positive</td> </tr>
	  <tr> <td>6</td> <td>class</td> <td>whether the sequence is a true positive, 'tp', or a false positive, 'fp'</td> </tr>
        </table>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'centrimo-results-tsv':
      html = `
	<p>
          CentriMo outputs a tab-separated values (TSV) file ('centrimo.tsv') that contains one line for each 
	  region found to be significantly enriched for a motif.
	  The lines are sorted in order of decreasing statistical significance.
          The first line contains the (tab-separated) names of the fields.
          Your command line is given at the end of the file in a comment line starting with the
          character '#'.
	</p>
	<p>
          The names and meanings of each of the fields in <a href="` + site_url + `/doc/centrimo-output-format.html#tsv_results">CentriMo Results TSV Format</a>,
          which depend on whether or not you provide control sequences to CentriMo, are described below.
	</p>
        <table class="dark" style="width:100%" border=1>
          <tr> <th>field</th> <th>name</th> <th>contents</th> </tr>
	  <tr> <td>1</td> <td>db_index</td> <td>The index of the motif file that contains the motif.  Motif
	      files are numbered in the order the appeared in the command line.</td> </tr>
	  <tr> <td>2</td> <td>motif_id</td> <td> ` + get_doc_text('motif-id') + `
	      If more than one motif has the same ID, CentriMo uses only the first such motif.
	      The name is single-quoted and preceded with '+' or '-' if you scanned separately with 
	      the reverse complement motif (using the <code>--sep</code> option).</td> </tr>
	  <tr> <td>3</td> <td>motif_alt_id</td> <td> ` + get_doc_text('motif-alt-id') + `</td> </tr>
	  <tr> <td>4</td> <td>consensus</td> <td> ` + get_doc_text('motif-cons') + `</td> </tr>
	  <tr> <td>5</td> <td>E-value</td> <td> ` + get_doc_text('centrimo-evalue') + `</td> </tr>
	  <tr> <td>6</td> <td>adj_p-value</td> <td> ` + get_doc_text('centrimo-adj-pvalue') + `
	      By default, a <i>p</i>-value is calculated by using the one-tailed binomial
	      test on the number of sequences with a match to the motif
	      that have their best match in the reported region;
              if you provided control sequences, the <i>p</i>-value of Fisher\'s exact test on the enrichment of 
              best matches in the positive sequences relative to the negative sequences is computed instead;
	      if you used the <code>--cd</code> option, the <i>p</i>-value is the probability that the average 
	      distance between the best site and the sequence center would be as low or lower than observed, 
	      computed using the cumulative Bates distribution, optimized over different score thresholds.
	      In all cases, the reported <i>p</i>-value has been adjusted for the number of regions
	      and/or score thresholds tested.</td> </tr>
	  <tr> <td>7</td> <td>log_adj_p-value</td> <td>Log of adjusted <i>p</i>-value.</td> </tr>
	  <tr> <td>8</td> <td>bin_location</td> <td>Location of the center of the most enriched region, or
		0 if you used the <code>--cd</code> option.
	  <tr> <td>9</td> <td>bin_width</td> <td> ` + get_doc_text('centrimo-bin-width') + `</td> </tr>
	  <tr> <td>10</td> <td>total_width</td> <td>The maximum number of regions possible for this motif
              <br>&nbsp;&nbsp;
	      round(sequence_length - motif_length + 1)/2,<br>
	      or the number of places the motif will fit if you used the <code>--cd</code> option.</td> </tr>
	  <tr> <td>11</td> <td>sites_in_bin</td> <td> ` + get_doc_text('centrimo-sites-in-bin') + `</td> </tr>
	  <tr> <td>12</td> <td>total_sites</td> <td>The number of sequences containing a match to the motif
	      above the score threshold.
	  <tr> <td>13</td> <td>p_success</td> <td>The probability of a random match falling into the enriched region:
	      <br>&nbsp;&nbsp;
	      bin_width / total_width</td> </tr>
	  <tr> <td>14</td> <td>p-value</td> <td>The uncorrected <i>p</i>-value before it gets adjusted for the
	      number of multiple tests to give the adjusted <i>p</i>-value.</td> </tr>
	  <tr> <td>15</td> <td>mult_tests</td> <td> ` + get_doc_text('centrimo-mult-tests') + `</td> </tr>
	  <tr> <th colspan=3>The following additional columns are present when you provide control sequences to CentriMo
	  (using the <code>--neg</code> option).</th> </tr>
	  <tr> <td>16</td> <td>neg_sites_in_bin</td> <td>The number of negative sequences where the best
	      match to the motif falls in the reported region.
	      This value is rounded but the underlying value may contain fractional counts.
	      Note: This number may be less than the number of negative have a best match in the region.
	      The reason for this is that a sequence may have many matches that score equally best.
	      If n matches have the best score in a sequence, 1/n is added to the
	      appropriate bin for each match.</td> </tr>
	  <tr> <td>17</td> <td>neg_sites</td> <td>The number of negative sequences containing a match to the
	      motif above the minimum score threshold.
	      When score optimization is enabled the score threshold may be raised
	      higher than the minimum.</td> </tr>
	  <tr> <td>18</td> <td>neg_adj_pvalue</td> <td>The probability that any tested region in the negative
	      sequences would be as enriched for best matches to this motif
	      according to the Binomial test.</td> </tr>
	  <tr> <td>19</td> <td>log_neg_adj_pvalue</td> <td>Log of negative adjusted <i>p</i>-value.</td> </tr>
	  <tr> <td>20</td> <td>fisher_adj_pvalue</td> <td>Fisher adjusted <i>p</i>-value before it gets adjusted for the
	      number of motifs in the input files(s).</td> </tr>
	  <tr> <td>21</td> <td>log_fisher_adj_pvalue</td> <td>Log of Fisher adjusted <i>p</i>-value.</td> </tr>
        </table>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'centrimo-sites-txt':
      html = `
	<p>
          CentriMo outputs a text file ('site_counts.txt') that contains,
	  for each motif, pairs of values (bin_position, site_count),
	  or triples of values (bin_position, site_count, neg_site_count) if
	  you provided control sequences to CentriMo.
	  This data can be used to plot the density of motif best matches (sites)
	  along the input sequences.  Fractional counts are possible if multiple (n)
	  bins contain the best match for a given sequence, with each bin  
	  receiving an incremental count of 1/n. 
	</p>
	<p>
	  The data for each motif begins with a header line with the format:
	  <br>&nbsp&nbsp
		DB &lt;db_number&gt; MOTIF &lt;id&gt; &lt;alt&gt;
	  </br>
	  where &lt;id&gt; and &lt;alt&gt; are as described above.
	  The following lines (up to the next header line) 
	  each contain a single value-pair or value-triple for the motif
	  named in the header line.
	</p>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'meme-chip-results-tsv':
      html = `
	<p>
          MEME-ChIP outputs a tab-separated values (TSV) file ('summary.tsv') that 
	  contains one line for each motif found by MEME-ChIP.
	  The lines are sorted in order of decreasing statistical significance.
	  The first line contains the (tab-separated) names of the fields.
	  Your command line is given at the end of the file in a comment line starting with the
	  character '#'.
	</p>
	<p>
          The names and meanings of the fields in the 
	  <a href="` + site_url + `/doc/meme-chip-output-format.html">MEME-ChIP Results Summary TSV Format</a> 
	  are described below. 
	</p>
        <table class="dark" style="width:100%" border=1>
          <tr> <th>field</th> <th>name</th> <th>contents</th> </tr>
          <tr> <td>1</td> <td>MOTIF_INDEX</td> <td>The index of the motif in the "Motifs in MEME text format" file ('combined.meme') 
		output by MEME-ChIP.</td> </tr>
          <tr> <td>2</td> <td>MOTIF_SOURCE</td> <td>The name of the program that found the <i>de novo</i> motif, or the
                name of the motif file containing the known motif.</td> </tr>
          <tr> <td>3</td> <td>MOTIF_ID</td> <td> ` + get_doc_text('motif-id') + `</td> </tr>
          <tr> <td>4</td> <td>ALT_ID</td> <td> ` + get_doc_text('motif-alt-id') + `</td> </tr>
          <tr> <td>5</td> <td>CONSENSUS</td> <td>The ID of the <i>de novo</i> motif, or a consensus sequence
                computed from the letter frequencies in the known motif
                (as described <a href="#consensus_doc">below</a>).</td> </tr>
          <tr> <td>6</td> <td>WIDTH</td> <td>The width of the motif.</td> </tr>
          <tr> <td>7</td> <td>SITES</td> <td>The number of sites reported by the <i>de novo</i> program, or the number
                of "Total Matches" reported by CentriMo.</td> </tr>
          <tr> <td>8</td> <td>E-VALUE</td> <td>The statistical significance of the motif.</td> </tr>
          <tr> <td>9</td> <td>E-VALUE_SOURCE</td> <td>The program that reported the <i>E</i>-value.</td> </tr>
          <tr> <td>10</td> <td>MOST_SIMILAR_MOTIF</td> <td>The known motif most similar to this motif according to Tomtom.</td> </tr>
          <tr> <td>11</td> <td>URL</td> <td>A link to a description of the most similar motif, or to the known motif.</td> </tr>
        </table>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'meme-chip-combined-motifs':
      html = `
        <p>
          MEME-ChIP outputs a text file ('combined.meme') containing all the significant motifs found by MEME-ChIP.
          The motifs are in <a href="` + site_url + `/doc/meme-format.html">Minimal MEME Motif format</a>, 
	  and their IDs correspond to the motif indices given in the "Summary in TSV Format" file ('summary.tsv').
        </p>
        </p>
          <b>Note:</b> The 'nsites=' and 'E=' fields in the motif headers are only
          relevant for the MEME and DREME motifs.  For known motifs, those values do
          not refer to the number of sites in the input sequences.
        </p>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'spamo-results-tsv':
      html = `
	<p>
          SpaMo outputs a tab-separated values (TSV) file ('spamo.tsv') that contains one line for each motif
	  found to be significantly enriched.
	  The lines are grouped by secondary motif and sorted in order of decreasing statistical significance.
          The first line contains the (tab-separated) names of the fields.
	  Your command line is given at the end of the file in a comment line starting with the character '#'.
	</p>
	<p>
	  The names and meanings of each of the fields in <a href="` + site_url + `/doc/spamo-output-format.html#results-tsv">SpaMo Results TSV Format</a> 
	  are described below. 
	</p>
	<table class="dark" style="width:100%" border=1>
	  <tr> <th>field</th> <th>name</th> <th>contents</th> </tr>
          <tr> <td>1</td> <td>prim_db</td> <td> ` + get_doc_text('motif-db', 'the primary motif.') + `</td> </tr>
          <tr> <td>2</td> <td>prim_id</td> <td> ` + get_doc_text('motif-id', 'primary') + `</td> </tr>
          <tr> <td>3</td> <td>prim_alt</td> <td> ` + get_doc_text('motif-alt-id', 'primary') + `</td> </tr>
          <tr> <td>4</td> <td>prim_cons</td> <td> ` + get_doc_text('motif-cons', 'primary') + `</td> </tr>
          <tr> <td>5</td> <td>sec_db</td> <td> ` + get_doc_text('motif-db', 'the secondary motif.') + `</td> </tr>
          <tr> <td>6</td> <td>sec_id</td> <td> ` + get_doc_text('motif-id', 'secondary') + `</td> </tr>
          <tr> <td>7</td> <td>sec_alt</td> <td> ` + get_doc_text('motif-alt-id', 'secondary') + `</td> </tr>
          <tr> <td>8</td> <td>sec_cons</td> <td> ` + get_doc_text('motif-cons', 'secondary') + `</td> </tr>
          <tr> <td>9</td> <td>trim_left</td> <td>Number of positions trimmed from left of secondary motif.</td> </tr>
          <tr> <td>10</td> <td>trim_right</td> <td>Number of positions trimmed from right of secondary motif.</td> </tr> 
          <tr> <th colspan=3>If the next three fields are not blank, the motif is redundant with a more significant ('parent') motif.</th> </tr>
          <tr> <td>11</td> <td>red_db</td> <td> ` + get_doc_text('motif-db', 'the parent motif.') + `</td> </tr>
          <tr> <td>12</td> <td>red_id</td> <td> ` + get_doc_text('motif-id', 'parent') + `</td> </tr>
          <tr> <td>13</td> <td>red_alt</td> <td> ` + get_doc_text('motif-alt-id', 'parent') + `</td> </tr>
          <tr> <td>14</td> <td>E-value</td> <td>The expected number motifs that would have least one spacing as enriched as the best spacing for this secondary. 
	    The <i>E</i>-value is the best spacing <i>p</i>-value multiplied by the number of motifs in the input database(s).</td> </tr>
          <tr> <td>15</td> <td>gap</td> <td>The distance between the edge of the primary and the (trimmed) secondary motif.</td> </tr>
          <tr> <td>16</td> <td>orient</td> <td>The (combination) of quadrants for which occurrences of this spacing are combined.</td> </tr>
          <tr> <td>17</td> <td>count</td> <td>The number of occurrences of the secondary motif with the given spacing and orientation to the primary motif.</td> </tr>
          <tr> <td>18</td> <td>total</td> <td>The total number of occurrences of the secondary motif within the margins around the best primary motif occurrence.</td> </tr>
          <tr> <td>19</td> <td>adj_p-value</td> <td>The <i>p</i>-value of the gap and orientation, adjusted for nine combinations of quadrants times the number of gaps tested (as controlled by the <code>-range</code> option).</td> </tr>
          <tr> <td>20</td> <td>p-value</td> <td>The <i>p</i>-value of the gap and orientation adjusted only for the number of gaps tested.</td> </tr>
        </table>
        <br>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'spamo-dumpseqs-tsv':
      html = `
	<p>
	  By specifying the options <code>--dumpseqs</code> or <code>--dumpsigs</code> 
	  you can have SpaMo create TSV (tab-separated values) files
	  describing the motif matches SpaMo used to make the histograms in its HTML output.
	  The files are named 
          '<code>seqs_&lt;primary_motif&gt;_&lt;secondary_db&gt;_&lt;secondary_motif&gt;.txt</code>'.
	  The rows in each file are sorted by sequence name.  
	  The first line contains the (tab-separated) names of the fields.
        </p>
	<p>
	  The names and meanings of each of the fields in <a href="` + site_url + `/doc/spamo-output-format.html#tsv_dumpseqs">SpaMo Dumpseqs TSV Format</a> 
	  are described below. 
        </p>
	<table class="dark" style="width:100%">
	  <tr><th>field</th><th>name</th><th>contents</th></tr>
	  <tr><td>1</td><td>matches</td><td>Trimmed lowercase sequence centered on primary match with matches in uppercase.</td></tr>
	  <tr><td>2</td><td>sec_pos</td><td>Position of the secondary match within the whole sequence.</td></tr>
	  <tr><td>3</td><td>pri_match</td><td>Sequence fragment that the primary matched.</td></tr>
	  <tr><td>4</td><td>pri_strand</td><td>Strand of the primary match (+/-).</td></tr>
	  <tr><td>5</td><td>sec_match</td><td>Sequence fragment that the secondary matched.</td></tr>
	  <tr><td>6</td><td>sec_strand</td><td>Strand of the secondary match (+/-).</td></tr>
	  <tr><td>7</td><td>same_opp</td><td>The primary match on the same (s) or opposite (o) strand as the secondary.</td></tr>
	  <tr><td>8</td><td>down_up</td><td>The secondary match is downstream (d) or upstream (u) of the primary.</td></tr>
	  <tr><td>9</td><td>gap</td><td>The gap between the primary and secondary matches.</td></tr>
	  <tr><td>10</td><td>seq_name</td><td>The name of the sequence.</td></tr>
	  <tr><td>11</td><td>adj_p-value</td><td>The <i>p</i>-value of the bin containing the match, adjusted for the number of bins.</td></tr>
	  <tr><th colspan="3">If the sequence names are in UCSC Genome Browser position
	  format (e.g., "chr5:36715616-36715623"), the following additional fields will be present:</th></tr>
	  <tr><td>12</td><td>pri_bed_chr</td><td>Position of primary match in BED coordinates.</td></tr>
	  <tr><td>13</td><td>pri_bed_start</td><td>"</td></tr>
	  <tr><td>14</td><td>pri_bed_end</td><td>"</td></tr>
	  <tr><td>15</td><td>pri_browser</td><td>Position of primary match in UCSC Genome Browser coordinates.</td></tr>
	  <tr><td>16</td><td>sec_bed_chr</td><td>Position of secondary match in BED coordinates.</td></tr>
	  <tr><td>16</td><td>sec_bed_start</td><td>"</td></tr>
	  <tr><td>16</td><td>sec_bed_end</td><td>"</td></tr>
	  <tr><td>19</td><td>sec_browser</td><td>Position of secondary match in UCSC Genome Browser coordinates.</td></tr>
	</table>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'fimo-results-tsv':
      html = ` 
        <p>
          FIMO outputs a tab-separated values (TSV) file ('fimo.tsv') that contains one line for each
          significant match to a motif.
          The lines are sorted in order of decreasing statistical significance (increasing <i>p</i>-value).
          The first line contains the (tab-separated) names of the fields.
          Your command line is given at the end of the file in a comment line starting with the
          character '#'.
        </p>
	<p>
	  The names and meanings of each of the fields in <a href="` + site_url + `/doc/fimo-output-format.html#results-tsv">FIMO Results TSV Format</a> 
	  are described below. 
	</p>
	<table class="dark" style="width:100%" border=1>
	  <tr> <th>field</th> <th>name</th> <th>contents</th> </tr>
          <tr> <td>1</td> <td>motif_id</td> <td> ` + get_doc_text('motif-id') + `</td> </tr>
          <tr> <td>2</td> <td>motif_alt_id</td> <td> ` + get_doc_text('motif-alt-id') + `</td> </tr>
          <tr> <td>3</td> <td>sequence_name</td> <td> ` + get_doc_text('sequence-id') + ` --OR-- the `
	    + get_doc_text('sequence-name') + `</td> </tr>
          <tr> <td>4</td> <td>start</td> <td> ` + get_doc_text('match-start-seq', 'motif occurrence') + ` --OR-- `
            + get_doc_text('match-start-genomic', 'motif occurrence') 
            + get_doc_text('parse-genomic-coord', 'The latter case occurs when FIMO') + `</td> </tr>
          <tr> <td>5</td> <td>stop</td> <td> ` + get_doc_text('match-stop-seq', 'motif occurrence') + ` --OR-- `
            + get_doc_text('match-stop-genomic', 'motif occurrence') 
            + get_doc_text('parse-genomic-coord', 'The latter case occurs when FIMO') + `</td> </tr>
          <tr> <td>6</td> <td>strand</td> <td>The strand '<code>+</code>' indicates the motif matched the forward
	    strand, '<code>-</code>' the reverse strand, and '<code>.</code>'
	    indicates strand is not applicable (as for amino acid sequences).</td> </tr>
          <tr> <td>7</td> <td>score</td> <td>The score for the motif occurrence. `
            + get_doc_text('motif-match-score') + `</td> </tr>
          <tr> <td>8</td> <td>p-value</td> <td> The <i>p</i>-value of the motif occurrence. `
            + get_doc_text('motif-match-p-value') + `</td> </tr>
          <tr> <td>9</td> <td>q-value</td> <td>The q-value of the motif occurrence. `
            + get_doc_text('bh-q-value', 'FIMO') + ` <b>Note:</b> This column is empty if you used the <span class=popt>--text</span> switch.</td> </tr>
          <tr> <td>10</td> <td>sequence</td> <td>The region of the sequence matched to the motif.</td> </tr>
        </table>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'fimo-results-gff3':
      html = `
        <p>
          FIMO outputs a GFF3</a> file ('fimo.gff') that contains one line for each
          significant match to a motif.
        </p>
        <p>
	  The GFF3 format is described <a href="http://gmod.org/wiki/GFF3">here</a>.
	  The 'score' reported in the FIMO GFF3 output</a> (in column 6) is<br/>
	  &nbsp;&nbsp;&nbsp;&nbsp;<code>min(1000, -10*(log10(pvalue)))</code>, <br/>
	  and the 'display name' ('Name=' tag in column 9) is composed of the contents of three 
	  fields as follows <br/>
	  &nbsp;&nbsp;&nbsp;&nbsp;<code>&lt;motif_id&gt;_&lt;sequence_name&gt;&lt;strand&gt;</code>.
        </p>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'gomo-results-tsv':
      html = `
        <p>
          GOMo outputs a tab-separated values (TSV) file ('gomo.tsv') that contains one line for each 
	  motif-GO-term pair found to be significantly enriched.
          The lines are grouped by motif and sorted in order of decreasing statistical significance.
          The first line contains the (tab-separated) names of the fields.
          Your command line is given at the end of the file in a comment line starting with the character '#'.
        </p>
        <p>
          The names and meanings of each of the fields in <a href="` + site_url + `/doc/gomo-output-format.html#results-tsv">GOMo Results TSV Format</a>
          are described below.
        </p>
        <table class="dark" style="width:100%" border=1>
          <tr> <th>field</th> <th>name</th> <th>contents</th> </tr>
          <tr> <td>1</td> <td>Motif_Identifier</td> <td> ` + get_doc_text('motif-id') + ` </td> </tr> 
          <tr> <td>2</td> <td>GO_Term_Identifier</td> <td> ` + get_doc_text('gomo-go-term') + ` </td> </tr>
          <tr> <td>3</td> <td>GOMo_Score</td> <td> ` + get_doc_text('gomo-score') + ` </td> </tr>
          <tr> <td>4</td> <td>p-value</td> <td> ` + get_doc_text('gomo-p-value') + ` </td> </tr>
          <tr> <td>5</td> <td>q-value</td> <td> ` + get_doc_text('bh-q-value', 'GOMo') + ` </td> </tr>
        </table>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'gomo-results-xml':
      html = `
	<p>
	GOMo outputs an XML file ('gomo.xml') with the following format.
	</p>
	<table class="bordertable" border="1">
	  <tr>
	    <th>Tag</th><th>Child of</th><th>Description</th>
	  </tr>
	  <tr>
	    <td >&lt;gomo&gt;</td><td >Nothing</td>
	    <td>
	      Information about this run of GOMo.
	      <ul>
		<li>version - The version of GOMo that generated the XML file.</li>
		<li>release - The release date of the version that generated the XML.</li>
	      </ul>
	    </td>
	  </tr>
	  <tr>
	    <td >&lt;program&gt;</td>
	    <td >&lt;gomo&gt;</td>
	    <td>
	      Information about the state of the program when it ran.<br />
	      <ul>
		<li>name - name of the program.</li>
		<li>cmd - the command line passed to the program.</li>
		<li>gene_url - the url used to lookup further information on the gene ids. 
		The url has ampersands (&amp;) converted into <b>&amp;amp;</b> and the place where
		  the gene ID should be replaced by <b>!!GENEID!!</b> .</li>
		<li>outdir - the output directory that the program wrote to.</li>
		<li>clobber - true if GOMo was allowed to overwrite the output directory.</li>
		<li>text_only - true if GOMo wrote to stdout, in which case this file would
		  not exist so it must be false.</li>
		<li>use_e_values - true if GOMo used <i>E</i>-values (converted from <i>p</i>-values) as 
		  input scores, false if GOMo used gene scores.</li>
		<li>score_e_thresh - if GOMo used <i>E</i>-values then this is the threshold that 
		  GOMo assumed the worst <i>E</i>-value (<i>p</i>-value = 1.0) for the gene to smooth out noise.</li>
		<li>min_gene_count - the minimum number of genes that a GO term was annotated 
		  with before GOMo would calculate a score for it.</li>
		<li>motifs - if present then a space delimited list of the motifs that GOMo
		  calculated a score for, otherwise GOMo scored all motifs.</li>
		<li>shuffle_scores - the number of times GOMo generated a shuffled mapping of
		  gene id to gene id to be used to generate scores from the null model.</li>
		<li>q_threshold - GOMo filtered the results to only show those with a better
		(smaller) q-value.</li>
	      </ul>
	    </td>
	  </tr>
	  <tr>
	    <td>&lt;gomapfile&gt;</td>
	    <td>&lt;program&gt;</td>
	    <td>
	      Information about the GO mapping file.<br />
	      <ul>
		<li>path - the path to the mapping file.</li>
	      </ul>
	    </td>
	  </tr>
	  <tr>
	    <td>&lt;seqscorefile&gt;</td>
	    <td>&lt;program&gt;</td>
	    <td>
	      Information about the sequence scoring file.<br />
	      <ul>
		<li>path - the path to the sequence scoring file.</li>
	      </ul>
	    </td>
	  </tr>
	  <tr>
	    <td>&lt;motif&gt;</td>
	    <td>&lt;gomo&gt;</td>
	    <td>
	      Information about the motif.<br />
	      <ul>
		<li>id - the motif identifier.</li>
		<li>genecount - the number of scored sequences that were used to compute the result.</li>
	      </ul>
	    </td>
	  </tr>
	  <tr>
	    <td>&lt;goterm&gt;</td>
	    <td>&lt;motif&gt;</td>
	    <td>
	      Information about the GO term.<br />
	      <ul>
		<li>id - the GO identifier.</li>
		<li>score - the geometric mean across all species of the rank-sum test <i>p</i>-value.</li>
		<li>pvalue - the empirically calculated <i>p</i>-value.</li>
		<li>qvalue - the empirically calculated q-value.</li>
		<li>annotated - the number of genes annotated with the go term.</li>
		<li>group - the subgroup that the term belongs to. For the Gene Ontology 
		    b = biological process, c = cellular component and m = molecular function.</li>
		<li>nabove - the number of more general terms that link to this one.</li>
		<li>nbelow - the number of more specific terms that link from this one.</li>
		<li>implied - is the go term implied by other significant go terms? 
		  Allows values 'y', 'n' or 'u' (default) for yes, no or unknown.</li>
		<li>description - the GO term description.</li>
	      </ul>
	    </td>
	  </tr>
	  <tr>
	    <td>&lt;gene&gt;</td>
	    <td>&lt;goterm&gt;</td>
	    <td>
	      Information about the GO term's annotated genes for the primary species.<br />
	      <ul>
		<li>id - the gene identifier.</li>
		<li>rank - the rank of the scored gene.</li>
	      </ul>
	    </td>
	  </tr>
        </table>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'mcast-results-tsv':
      html = ` 
        <p>
          MCAST outputs a tab-separated values (TSV) file ('mcast.tsv') that contains one line for each
          significant match of a cluster of motifs to a sequence region.
          The lines are sorted in order of decreasing statistical significance (increasing <i>p</i>-value).
          The first line contains the (tab-separated) names of the fields.
          Your command line is given at the end of the file in a comment line starting with the
          character '#'.
        </p>
	<p>
	  The names and meanings of each of the fields in 
          <a href="` + site_url + `/doc/mcast-output-format.html#results-tsv">MCAST Results TSV Format</a> 
	  are described below. 
	</p>
	<table class="dark" style="width:100%" border=1>
	  <tr> <th>field</th> <th>name</th> <th>contents</th> </tr>
          <tr> <td>1</td> <td>pattern_name</td> <td>A unique name that MCAST generates for the match. </td> </tr>
          <tr> <td>2</td> <td>sequence_name</td> <td> ` + get_doc_text('sequence-id') + ` --OR-- the `
	    + get_doc_text('sequence-name') + `</td> </tr>
          <tr> <td>3</td> <td>start</td> <td> ` + get_doc_text('match-start-seq', 'matched sequence region') + ` --OR-- `
            + get_doc_text('match-start-genomic', 'motif occurrence')
            + get_doc_text('parse-genomic-coord', 'The latter case occurs when MCAST') + `</td> </tr>
          <tr> <td>4</td> <td>stop</td> <td> ` + get_doc_text('match-stop-seq', 'matched sequence region') + ` --OR-- `
            + get_doc_text('match-stop-genomic', 'motif occurrence')
            + get_doc_text('parse-genomic-coord', 'The latter case occurs when MCAST') + `</td> </tr>
          <tr> <td>5</td> <td>score</td> <td> ` + get_doc_text('mcast-cluster-score') + ` </td> </tr>
          <tr> <td>6</td> <td>p-value</td> <td> ` + get_doc_text('mcast-cluster-p-value') + ` </td> </tr>
          <tr> <td>7</td> <td>E-value</td> <td> ` + get_doc_text('mcast-cluster-E-value') + ` </td> </tr>
          <tr> <td>8</td> <td>q-value</td> <td> ` + get_doc_text('bh-q-value', 'MCAST') + ` 
	    <b>Note:</b> This column is empty if you used the <span class=popt>--text</span> switch.</td> </tr>
          <tr> <td>9</td> <td>sequence</td> <td>The region of the sequence matched to the motif cluster.</td> </tr>
        </table>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'mcast-results-gff3':
      html = `
        <p>
          MCAST outputs a GFF3</a> file ('mcast.gff') that contains one line for each
          significant match to a motif cluster.
        </p>
        <p>
	  The GFF3 format is described <a href="http://gmod.org/wiki/GFF3">here</a>.
	  The 'score' reported in the MCAST GFF3 output</a> (in column 6) is<br/>
	  &nbsp;&nbsp;&nbsp;&nbsp;<code>min(1000, -10*(log10(pvalue)))</code>, <br/>
	  and the 'unique identifier' ('ID=' tag in column 9) is the value of the
	  &lt;pattern_name&gt; field in the MCAST results TSV format.  Following the
	  unique identifier in column 9, the <i>p</i>-value, <i>E</i>-value and q-value
	  of the match are given.
        </p>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    case 'tomtom-results-tsv':
      html = `
	<p>
          Tomtom outputs a tab-separated values (TSV) file ('tomtom.tsv') that contains one line for each motif
	  found to be significantly enriched.
	  The lines are grouped by query motif and sorted in order of decreasing statistical significance.
          The first line contains the (tab-separated) names of the fields.
	  Your command line is given at the end of the file in a comment line starting with the character '#'.
	</p>
	<p>
	  The names and meanings of each of the fields in <a href="` + site_url + `/doc/tomtom-output-format.html#results-tsv">Tomtom Results TSV Format</a> 
	  are described below. 
	</p>
	<table class="dark" style="width:100%" border=1>
	  <tr> <th>field</th> <th>name</th> <th>contents</th> </tr>
          <tr> <td>1</td> <td>Query_ID</td> <td> ` + get_doc_text('motif-id', 'query') + `</td> </tr>
          <tr> <td>2</td> <td>Target_ID</td> <td> ` + get_doc_text('motif-id', 'target') + `</td> </tr>
          <tr> <td>3</td> <td>Optimal_offset</td> <td> ` + get_doc_text('tomtom-offset') + `</td> </tr>
          <tr> <td>4</td> <td>p-value</td> <td> ` + get_doc_text('tomtom-p-value') + `</td> </tr>
          <tr> <td>5</td> <td>E-value</td> <td> ` + get_doc_text('tomtom-E-value') + `</td> </tr>
          <tr> <td>6</td> <td>q-value</td> <td> ` + get_doc_text('bh-q-value', 'Tomtom') + `</td> </tr>
          <tr> <td>7</td> <td>Overlap</td> <td> ` + get_doc_text('tomtom-overlap') + `</td> </tr>
          <tr> <td>8</td> <td>Query_consensus</td> <td>A consensus sequence
                computed from the letter frequencies in the query motif
                (as described <a href="#consensus_doc">below</a>).</td> </tr>
          <tr> <td>9</td> <td>Target_consensus</td> <td>A consensus sequence
                computed from the letter frequencies in the target motif
                (as described <a href="#consensus_doc">below</a>).</td> </tr>
          <tr> <td>10</td> <td>Orientation</td> <td> ` + get_doc_text('tomtom-orientation', "<br>A value of '+' means that the target motif is as it appears in the database. A value of '-' means that the reverse complement of the target motif is shown.") + `</td> </tr>
        </table>
      `;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
      break;

    default:
      html = "Error--Unrecognized doc_type: " + doc_type;
      document.getElementById(id).insertAdjacentHTML('beforeend', html);
  }
} // print_doc

//
// Function to return the HTML text of a given type.
// This function can be used directly to document the output format (xx-output-format.html)
// and indirectly via print_doc_para for help pop-ups in the actual output HTML,
// to prevent duplication of documentation.
//
function get_doc_text(doc_type, extra) {
  var html;
  if (extra == undefined) {extra = ""};

  switch (doc_type) {

    // shared
    case 'motif-db':
      return(`
	The name of a file of motifs ("motif database file") that contains ` + extra + `
      `);
    case 'motif-id':
      return(`
	The name of the ` + extra + ` motif, which is unique in the motif database file.
      `);
    case 'motif-alt-id':
      return(`
	An alternate name for the ` + extra + ` motif, which may be provided in the motif database file.
      `);
    case 'motif-width':
      return(`
	The width of the motif. No gaps are allowed in motifs supplied to ` + extra + `
        as it only works for motifs of a fixed width.
      `);
    case 'motif-cons':
      return(`
	A consensus sequence computed from the ` + extra + ` motif (as described <a href="#consensus_doc">below</a>).
      `);
    case 'motif-match-score':
     return(`
	The score for the match of a position in a sequence to a motif is
	computed by summing the appropriate entry from each column of the
	position-dependent scoring matrix that represents the motif. ` + extra + `
     `);
    case 'motif-match-p-value':
      return(`
	The <i>p</i>-value of a motif match is the probability of a single random
	subsequence of the length of the motif
	<a href="javascript:help_refine('pop_motif_match_score')">scoring</a>
	at least as well as the observed match.
      `);
    case 'bh-q-value-method':
      return(`
        ` + extra + ` estimates q-values from all the match <i>p</i>-values 
	using the method proposed by Benjamini & Hochberg (<i>Journal of the Royal Statistical Society B</i>, 57:289-300, 1995).
	See also Storey JD, Tibshirani R. Statistical significance for
	genome-wide studies, <i>Proc. Natl. Acad. Sci. USA</i> (2003) <b>100</b>:9440&ndash;9445.
      `);
    case 'bh-q-value':
      return(`
	The minimum False Discovery Rate (FDR) required to consider this match significant.</br>` + get_doc_text('bh-q-value-method', extra) + `
      `);
    case 'sdb-name':
      return(`
	The name of the (FASTA) sequence database file.
      `);
    case 'sdb-psp':
      return(`
	The name of the position specific priors (PSP) file.
      `);
    case 'sdb-dist':
      return(`
	The name of the binned distribution of priors file.
      `);
    case 'sdb-count':
      return(`
	The number of sequences in the database.
      `);
    case 'sdb-letters':
      return(`
	The number of letters in the sequence database.
      `);
    case 'lastmod':
      return(`
	The date of the last modification to the ` + extra + ` database.
      `);
    case 'sequence-id':
      return(`
        The identifier of the sequence (from the FASTA sequence header line)` + extra + `
      `);
    case 'sequence-name':
      return(`
	` + extra + `name of the sequence extracted from the sequence identifier (in the FASTA sequence header line).<br>
	When you use the <code>--parse-genomic--coord</code> option, the sequence name ends at the
	first colon ':' (if any) present in the sequence\'s FASTA identifier.  Typically this is the
	chromosome or contig name.  With the <code>--parse-genomic--coord</code> option,
	the start and stop positions are in 0-based coordinates relative to the sequence start given 
	in the FASTA sequence identifier (just after the sequence name).</td> </tr>
      `);
    case 'sequence-desc':
      return(`
        The description appearing after the identifier of the sequence in the FASTA header line.
      `);
    case 'sequence-name':
    case 'alph-name':
      return(`
	The name of the alphabet symbol.
      `);
    case 'alph-bg':
      return(`
	The frequency of the alphabet symbol as defined by the background model.
      `);
    case 'match-start-seq':
      return(`
	The start position of the ` + extra + `; 1-based sequence coordinates.
      `);
    case 'match-stop-seq':
      return(`
	The end position of the ` + extra + `; 1-based sequence coordinates.
      `);
    case 'match-start-genomic':
      return(`
	The start position of the ` + extra + `; genomic coordinates.
      `);
    case 'match-stop-genomic':
      return(`
	The end position of the ` + extra + `; genomic coordinates.
      `);
    case 'parse-genomic-coord':
      return(`
	` + extra + ` was run with the <code>--parse-genomic-coord</code> option
	and has split the sequence identifier into sequence name, sequence start and sequence end 
	in genomic coordinates.
      `);

    // AME
    case 'ame-pvalue':
      return(`
	The optimal enrichment <i>p</i>-value of the motif according to the statistical test;
	not adjusted for multiple tests.
      `);
    case 'ame-adj-pvalue':
      return(`
	The optimal enrichment <i>p</i>-value of the motif according to the statistical test,
        adjusted for multiple tests using a Bonferroni correction. ` + extra + `
	If the best <i>p</i>-value is <i>p</i> before adjustment,
        and the number of multiple tests is <i>n</i>, then the adjusted
        <i>p</i>-value is 1 - (1-<i>p</i>)<i><sup>n</sup></i>.
      `);
    case 'ame-evalue':
      return(`
	The expected number of motifs that would be as enriched in the
        (primary) sequences as this one.  The <i>E</i>-value is the adjusted <i>p</i>-value
        multiplied by the number of motifs in the motif file(s).
      `);

    // CentriMo
    case 'centrimo-adj-pvalue':
      return(`
        The statistical significance of the enrichment of the motif, adjusted for multiple tests. ` + extra + `
      `);
    case 'centrimo-evalue':
      var evalue_html = `
        at least one region as enriched for best matches to the motif as the reported region
	(or would have optimal average distance to the sequence center as low as observed, 
	if you used the <code>--cd</code> option).
      `;
      return(`
	The expected number motifs that would have ` + (extra ? extra : evalue_html) + `
	The <i>E</i>-value is the adjusted <i>p</i>-value multiplied by the number of motifs in the
	input files(s).</td> </tr>
      `);
    case 'centrimo-bin-width':
      return(`
        The width (in sequence positions) of the most enriched region (default),
        <b>or</b> two times the average distance between the center of the best site
        and the sequence center if you used the option <code>--cd</code>.
        A best match to the motif is counted as being in the region if
        the center of the motif falls in the region.
      `);
    case 'centrimo-sites-in-bin':
      return(`
	The number of (positive) sequences whose best match to the motif `
	+ (extra ? extra : "falls in the reported region (default) or anywhere in the sequence (if you used the option <code>--cd</code>).") + `
	<br>Note: This number may be less than the number of
	(positive) sequences that have a best match in the region.
	The reason for this is that a sequence may have many matches that score
	equally best.  If <i>n</i> matches have the best score in a sequence, 1/<i>n</i> is added to the
	appropriate bin for each match.</td> </tr>
      `);
    case 'centrimo-mult-tests':
      return(`
	This is the number of multiple tests (<i>n</i>) done for this motif.
	It was used to adjust the <i>p</i>-value of a region for
	multiple tests using the formula:
	<br>&nbsp;&nbsp;
	  <i>p</i>' = 1 - (1-<i>p</i>)<sup><i>n</i></sup> where <i>p</i> is the unadjusted <i>p</i>-value.
	<br>
	The number of multiple tests is the number of regions
	considered times the number of score thresholds considered.
	It depends on the motif length, sequence length, and the type of
	optimizations being done (central enrichment, local enrichment, central distance or
	score optimization).</td> </tr>
      `);

    // GOMo
    case 'gomo-go-term':
      return(`
        The Gene Ontology Consortium term for a specific role or locality.
        Used for annotating genes with their functions.
      `);
    case 'gomo-score':
      return( `
	A score generated as the <a href="https://en.wikipedia.org/wiki/Geometric_mean">
	geometric mean</a> of <a href="https://en.wikipedia.org/wiki/Mann-Whitney_U_test">rank-sum test(s)</a> 
	for the particular Gene Ontology term. The two groups compared by the rank-sum test are scores of genes annotated 
	with the GO term and scores of genes not annotated with the GO term.</td> </tr>
      `);
    case 'gomo-p-value':
      return( `
	An empirically generated <i>p</i>-value for the enrichment of the GO term.<br>
	The null hypothesis is that by shuffling the labels on gene scores, 
	any possible association between the set of genes that a GO term annotates is destroyed. 
	A large number of scores are generated using the null hypothesis and the number of null 
	hypothesis scores that are better than each of the real scores is summed and then divided 
	by the total null hypothesis scores generated to calculate a <i>p</i>-value.</td> </tr>
      `);

    // MAST

    // MCAST
    case 'mcast-cluster-score':
      return( `
        The score that the hidden Markov model created by MCAST assigned to the motif cluster.<br>
        This is the sum of the scores of the individual motif matches in the cluster, plus a
        gap penalty, <i>g</i>, multiplied by the total size of the inter-motif gaps
        in the cluster.  Individual motif match scores are log2(<i>P(s)/p</i>), where <i>s</i> is the 
        <a href="javascript:help_refine('pop_motif_match_score')">log-odds score</a> 
        of the motif match, <i>P(s)</i> is the 
        <a href="javascript:help_refine('pop_motif_match_pvalue')"><i>p</i>-value</a> 
	of the motif match, and <i>p</i> is the user-specified <i>p</i>-value threshold (default: 0.0005).
        <div class="active" id="pop_motif_match_score_act"></div>
        <div class="active" id="pop_motif_match_pvalue_act"></div>
      `);
    case 'mcast-cluster-p-value':
      return( `
	The <i>p</i>-value of the motif cluster score.<br>
	MCAST estimates <i>p</i>-values by fitting an exponential distribution
	to the observed motif cluster scores.
      `);
    case 'mcast-cluster-E-value':
      return( `
        The <i>E</i>-value of the motif cluster score.<br>
	The <i>E</i>-value is an estimate of the <i>number</i> of false positive matches
	with <i>p</i>-values at least as good as this match\'s.  
        MCAST estimates this by multiplying the motif cluster score <i>p</i>-value
        times the (estimated) number of random matches found in the search.
      `);

    // Tomtom
    case 'tomtom-offset':
      return( `
        The offset of the query motif relative to the target motif in the optimal alignment.<br>
 	A positive value indicates the query is shifted right.
      `);
    case 'tomtom-p-value':
      return( `
        The probability that a random motif of the same width as the target would have an 
	optimal alignment with a match score as good or better than the target's.<br>
	Tomtom estimates the <i>p</i>-value using a null model consisting of sampling
	motif columns from all the columns in the set of target motifs.
      `);
    case 'tomtom-E-value':
      return( `
	The expected number of false positives in the matches up to this point.<br>
	Tomtom estimates the <i>E</i>-value by multiplying the <i>p</i>-value by
	the total number of target motifs in all the target databases.
      `);
    case 'tomtom-overlap':
      return( `
	The number of motif columns that overlap in the optimal alignment.
      `);
    case 'tomtom-orientation':
      return( `
	The orientation of the target motif that gave the optimal alignment. ` + extra + `
      `);
  }

} // get_doc_text

//
// Function to replace the innerHTML of element "id" with an HTML paragraph
// containing the text for 'doc_type', which is known to function get_doc_text.
// This function can be used in help pop-ups.
//
function print_doc_para(id, doc_type, extra) {
  html = `<p>` + get_doc_text(doc_type, extra) + `</p>`; 
  document.getElementById(id).insertAdjacentHTML('beforeend', html);
} // print_doc_para
</script>
    <script>
function make_alpha_bg_table(alph, freqs) {
  function colour_symbol(index) {
    var span = document.createElement("span");
    span.appendChild(document.createTextNode(alph.get_symbol(index)));
    span.style.color = alph.get_colour(index);
    span.className = "alpha_symbol";
    return span;
  }
  var table, thead, tbody, row, th, span, i;
  // create table
  table = document.createElement("table");
  table.className = "alpha_bg_table";
  // create header
  thead = document.createElement("thead");
  table.appendChild(thead);
  row = thead.insertRow(thead.rows.length);
  if (alph.has_complement()) {
    add_text_header_cell(row, "Name", "pop_alph_name");
    if (freqs != null) add_text_header_cell(row, "Freq.", "pop_alph_freq");
    if (alph.has_bg()) add_text_header_cell(row, "Bg.", "pop_alph_bg");
    add_text_header_cell(row, "");
    add_text_header_cell(row, "");
    add_text_header_cell(row, "");
    if (alph.has_bg()) add_text_header_cell(row, "Bg.", "pop_alph_bg");
    if (freqs != null) add_text_header_cell(row, "Freq.", "pop_alph_freq");
    add_text_header_cell(row, "Name", "pop_alph_name");
  } else {
    add_text_header_cell(row, "");
    add_text_header_cell(row, "Name", "pop_alph_name");
    if (freqs != null) add_text_header_cell(row, "Freq.", "pop_alph_freq");
    if (alph.has_bg()) add_text_header_cell(row, "Bg.", "pop_alph_bg");
  }
  // add alphabet entries
  tbody = document.createElement("tbody");
  table.appendChild(tbody);
  if (alph.has_complement()) {
    for (i = 0; i < alph.get_size_core(); i++) {
      var c = alph.get_complement(i);
      if (i > c) continue;
      row = tbody.insertRow(tbody.rows.length);
      add_text_cell(row, alph.get_name(i));
      if (freqs != null) add_text_cell(row, "" + freqs[i]);
      if (alph.has_bg()) add_text_cell(row, "" + alph.get_bg_freq(i));
      add_cell(row, colour_symbol(i)); 
      add_text_cell(row, "~");
      add_cell(row, colour_symbol(c)); 
      if (alph.has_bg()) add_text_cell(row, "" + alph.get_bg_freq(c));
      if (freqs != null) add_text_cell(row, "" + freqs[c]);
      add_text_cell(row, alph.get_name(c));
    }
  } else {
    for (i = 0; i < alph.get_size_core(); i++) {
      row = tbody.insertRow(tbody.rows.length);
      add_cell(row, colour_symbol(i)); 
      add_text_cell(row, alph.get_name(i));
      if (freqs != null) add_text_cell(row, "" + freqs[i]);
      if (alph.has_bg()) add_text_cell(row, "" + alph.get_bg_freq(i));
    }
  }
  return table;
}

</script>
    <script>
      // 
      // return true if any part of the passed element is visible in the viewport
      //
      function element_in_viewport(elem) {
        var rect;
        try {
          rect = elem.getBoundingClientRect();
        } catch (e) {
          return false;
        }
        return (
            rect.top < (window.innerHeight || document.body.clientHeight) &&
            rect.bottom > 0 &&
            rect.left < (window.innerWidth || document.body.clientWidth) &&
            rect.right > 0
            );
      }

      //
      // Functions to delay a drawing task until it is required or it would not lag the display to do so
      //

      // a list of items still to be drawn
      var drawable_list = [];
      // the delay between drawing objects that are not currently visible
      var draw_delay = 1;
      // the delay after a user interaction
      var user_delay = 300;
      // the delay after a user has stopped scrolling and is viewing the stuff drawn on the current page
      var stop_delay = 300;
      // the timer handle; allows resetting of the timer after user interactions
      var draw_timer = null;

      //
      // Drawable
      //
      // elem - a page element which defines the position on the page that drawing is to be done
      // task - an object with the method run which takes care of painting the object
      //
      var Drawable = function(elem, task) {
        this.elem = elem;
        this.task = task;
      }

      //
      // Drawable.is_visible
      //
      // Determines if the element is visible in the viewport
      //
      Drawable.prototype.is_visible = function() {
        return element_in_viewport(this.elem);
      }

      //
      // Drawable.run
      //
      // Run the task held by the drawable
      Drawable.prototype.run = function() {
        if (this.task) this.task.run();
        this.task = null;
      }

      //
      // Drawable.run
      //
      // Run the task iff visible
      // returns true if the task ran or has already run
      Drawable.prototype.run_visible = function() {
        if (this.task) {
          if (element_in_viewport(this.elem)) {
            this.task.run();
            this.task = null;
            return true;
          }
          return false;
        } else {
          return true;
        }
      }

      //
      // draw_on_screen
      //
      // Checks each drawable object and draws those on screen.
      //
      function draw_on_screen() {
        var found = false;
        for (var i = 0; i < drawable_list.length; i++) {
          if (drawable_list[i].run_visible()) {
            drawable_list.splice(i--, 1);
            found = true;
          }
        }
        return found;
      }

      //
      // process_draw_tasks
      //
      // Called on a delay to process the next available
      // draw task.
      //
      function process_draw_tasks() {
        var delay = draw_delay;
        draw_timer = null;
        if (drawable_list.length == 0) return; //no more tasks
        if (draw_on_screen()) {
          delay = stop_delay; //give the user a chance to scroll
        } else {
          //get next task
          var drawable = drawable_list.shift();
          drawable.task.run();
        }
        //allow UI updates between tasks
        draw_timer = window.setTimeout("process_draw_tasks()", delay);
      }

      //
      // delayed_process_draw_tasks
      //
      // Call process_draw_tasks after a short delay.
      // The delay serves to group multiple redundant events.       
      // Should be set as event handler for onscroll and onresize.
      //
      function delayed_process_draw_tasks() {
        //reset the timer
        if (drawable_list.length > 0) { 
          if (draw_timer != null) clearTimeout(draw_timer);
          draw_timer = window.setTimeout("process_draw_tasks()", user_delay);
        }
      }

      //
      // add_draw_task
      //
      // Add a drawing task to be called immediately if it is
      // visible, or to be called on a delay to reduce stuttering
      // effect on the web browser.
      function add_draw_task(elem, task) {
        drawable = new Drawable(elem, task);
        if (drawable.is_visible()) {
          task.run();
        } else {
          drawable_list.push(drawable);
          //reset timer
          if (draw_timer != null) clearTimeout(draw_timer);
          draw_timer = window.setTimeout("process_draw_tasks()", user_delay);
        }
      }

</script>
    <script>
//======================================================================
// start Alphabet object
//======================================================================
var Alphabet = function(alphabet, background) {
  "use strict";
  var i, j, sym, aliases, complement, comp_e_sym, ambigs, generate_background;
  generate_background = (background == null);
  if (generate_background) {
    background = [];
    for (i = 0; i < alphabet.ncore; i++) background[i] = 1.0 / alphabet.ncore;
  } else if (alphabet.ncore != background.length) {
    throw new Error("The background length does not match the alphabet length.");
  }
  this.name = alphabet.name;
  this.like = (alphabet.like != null ? alphabet.like.toUpperCase() : null);
  this.ncore = alphabet.ncore;
  this.symbols = alphabet.symbols;
  this.background = background;
  this.genbg = generate_background;
  this.encode = {};
  this.encode2core = {};
  this.complement = {};
  // check if all symbols are same case
  var seen_uc = false;
  var seen_lc = false;
  var check_case = function (syms) {
    var s, sym;
    if (typeof syms === "string") {
      for (s = 0; s < syms.length; s++) {
        sym = syms.charAt(s);
        if (sym >= 'a' && sym <= 'z') seen_lc = true;
        else if (sym >= 'A' && sym <= 'Z') seen_uc = true;
      }
    }
  };
  for (i = 0; i < this.symbols.length; i++) {
    check_case(this.symbols[i].symbol);
    check_case(this.symbols[i].aliases);
  }
  // now map symbols to indexes
  var update_array = function(array, syms, index) {
    var s, sym;
    if (typeof syms === "string") {
      for (s = 0; s < syms.length; s++) {
        sym = syms.charAt(s);
        array[sym] = index;
        // when only a single case is used, then encode as case insensitive
        if (seen_uc != seen_lc) {
          if (sym >= 'a' && sym <= 'z') {
            array[sym.toUpperCase()] = index;
          } else if (sym >= 'A' && sym <= 'Z') {
            array[sym.toLowerCase()] = index;
          }
        }
      }
    }
  }
  // map core symbols to index
  for (i = 0; i < this.ncore; i++) {
    update_array(this.encode2core, this.symbols[i].symbol, i);
    update_array(this.encode, this.symbols[i].symbol, i);
    update_array(this.encode2core, this.symbols[i].aliases, i);
    update_array(this.encode, this.symbols[i].aliases, i);
  }
  // map ambiguous symbols to index
  ambigs = {};
  for (i = this.ncore; i < this.symbols.length; i++) {
    update_array(this.encode, this.symbols[i].symbol, i);
    update_array(this.encode, this.symbols[i].aliases, i);
    ambigs[this.symbols[i].equals] = i;
  }
  // determine complements
  for (i = 0; i < this.ncore; i++) {
    complement = this.symbols[i].complement;
    if (typeof complement === "string") {
      this.complement[i] = this.encode2core[complement];
    }
  }
  next_symbol:
  for (i = this.ncore; i < this.symbols.length; i++) {
    complement = "";
    for (j = 0; j < this.symbols[i].equals.length; j++) {
      comp_e_sym = this.complement[this.encode2core[this.symbols[i].equals.charAt(j)]];
      if (typeof comp_e_sym !== "number") continue next_symbol;
      complement += this.symbols[comp_e_sym].symbol;
    }
    complement = complement.split("").sort().join("");
    if (typeof ambigs[complement] === "number") {
      this.complement[i] = ambigs[complement];
    }
  }
  // determine case insensitivity
  this.case_insensitive = true;
  if (seen_uc == seen_lc) {
    // when there is a mixture of cases it probably won't
    // be case insensitive but we still need to check
    loop:
    for (i = 0; i < this.symbols.length; i++) {
      sym = this.symbols[i].symbol;
      if (sym >= 'A' && sym <= 'Z') {
        if (this.encode[sym.toLowerCase()] != i) {
          this.case_insensitive = false;
          break loop;
        }
      } else if (sym >= 'a' && sym <= 'z') {
        if (this.encode[sym.toUpperCase()] != i) {
          this.case_insensitive = false;
          break loop;
        }
      }
      aliases = this.symbols[i].aliases;
      if (aliases != null) {
        for (j = 0; j < aliases.length; j++) {
          sym = aliases.charAt(j);
          if (sym >= 'A' && sym <= 'Z') {
            if (this.encode[sym.toLowerCase()] != i) {
              this.case_insensitive = false;
              break loop;
            }
          } else if (sym >= 'a' && sym <= 'z') {
            if (this.encode[sym.toUpperCase()] != i) {
              this.case_insensitive = false;
              break loop;
            }
          }
        }
      }
    }
  }
  // normalise aliases to remove the prime symbol and eliminate
  // the alternate cases when the alphabet is case insensitive
  var seen, out;
  for (i = 0; i < this.symbols.length; i++) {
    sym = this.symbols[i].symbol;
    aliases = this.symbols[i].aliases;
    if (typeof aliases != "string") aliases = "";
    seen = {};
    out = [];
    if (this.case_insensitive) {
      sym = sym.toUpperCase();
      aliases = aliases.toUpperCase();
    }
    seen[sym] = true;
    for (j = 0; j < aliases.length; j++) {
      if (!seen[aliases.charAt(j)]) {
        seen[aliases.charAt(j)] = true;
        out.push(aliases.charAt(j));
      }
    }
    this.symbols[i].aliases = out.sort().join("");
  }
};
// return the name of the alphabet
Alphabet.prototype.get_alphabet_name = function() {
  return this.name;
};
// return if the alphabet can be complemented
Alphabet.prototype.has_complement = function() {
  return (typeof this.symbols[0].complement === "string");
};
// return true if an uppercase letter has the same meaning as the lowercase form
Alphabet.prototype.is_case_insensitive = function() {
  return this.case_insensitive;
};
// return the information content of an alphabet letter
Alphabet.prototype.get_ic = function() {
  return Math.log(this.ncore) / Math.LN2;
};
// return the count of the core alphabet symbols
Alphabet.prototype.get_size_core = function() {
  return this.ncore;
};
// return the count of all alphabet symbols
Alphabet.prototype.get_size_full = function() {
  return this.symbols.length;
};
// return the symbol for the given alphabet index
Alphabet.prototype.get_symbol = function(alph_index) {
  "use strict";
  if (alph_index < 0 || alph_index >= this.symbols.length) {
    throw new Error("Alphabet index out of bounds");
  }
  return this.symbols[alph_index].symbol;
};
// return the aliases for the given alphabet index
Alphabet.prototype.get_aliases = function(alph_index) {
  "use strict";
  if (alph_index < 0 || alph_index >= this.symbols.length) {
    throw new Error("Alphabet index out of bounds");
  }
  var sym_obj = this.symbols[alph_index];
  return (sym_obj.aliases != null ? sym_obj.aliases : "");
};
// return the name for the given alphabet index
Alphabet.prototype.get_name = function(alph_index) {
  "use strict";
  var sym;
  if (alph_index < 0 || alph_index >= this.symbols.length) {
    throw new Error("Alphabet index out of bounds");
  }
  sym = this.symbols[alph_index];
  return (typeof sym.name === "string" ? sym.name : sym.symbol);
};
// return the alphabet it is like or null
Alphabet.prototype.get_like = function() {
  "use strict";
  return this.like;
};
// return the index of the complement for the given alphabet index
Alphabet.prototype.get_complement = function(alph_index) {
  var comp_e_sym = this.complement[alph_index];
  if (typeof comp_e_sym === "number") {
    return comp_e_sym;
  } else {
    return -1;
  }
};
// return a string containing the core symbols
Alphabet.prototype.get_symbols = function() {
  "use strict";
  var i, core_symbols;
  core_symbols = "";
  for (i = 0; i < this.ncore; i++) {
    core_symbols += this.symbols[i].symbol;
  }
  return core_symbols;
};
// return if the background was not a uniform generated background
Alphabet.prototype.has_bg = function() {
  "use strict";
  return !this.genbg;
};
// get the background frequency for the index
Alphabet.prototype.get_bg_freq = function(alph_index) {
  "use strict";
  var freq, i, symbols;
  if (alph_index >= 0) {
    if (alph_index < this.ncore) {
      return this.background[alph_index];
    } else if (alph_index < this.symbols.length) {
      freq = 0;
      symbols = this.symbols[alph_index].equals;
      for (i = 0; i < symbols.length; i++) {
        freq += this.background[this.encode2core[symbols.charAt(i)]];
      }
      return freq;
    } 
  }
  throw new Error("The alphabet index is out of range.");
};
// get the colour of the index
Alphabet.prototype.get_colour = function(alph_index) {
  "use strict";
  if (alph_index < 0 || alph_index >= this.symbols.length) {
    throw new Error("BAD_ALPHABET_INDEX");
  }
  if (typeof this.symbols[alph_index].colour != "string") {
    return "black";
  }
  return "#" + this.symbols[alph_index].colour;
};
// get the rgb components of the colour at the index
Alphabet.prototype.get_rgb = function(alph_index) {
  "use strict";
  if (alph_index < 0 || alph_index >= this.symbols.length) {
    throw new Error("BAD_ALPHABET_INDEX");
  }
  if (typeof this.symbols[alph_index].colour != "string") {
    return {"red": 0, "green": 0, "blue": 0};
  }
  var colour = this.symbols[alph_index].colour;
  var red = parseInt(colour.substr(0, 2), 16) / 255;
  var green = parseInt(colour.substr(2, 2), 16) / 255;
  var blue = parseInt(colour.substr(4, 2), 16) / 255;
  return {"red": red, "green": green, "blue": blue};
};
// convert a symbol into the index
Alphabet.prototype.get_index = function(letter) {
  "use strict";
  var alph_index;
  alph_index = this.encode[letter];
  if (typeof alph_index === "undefined") {
    return -1;
  }
  return alph_index;
};
// convert a symbol into the list of core indexes that it equals
Alphabet.prototype.get_indexes = function(letter) {
  "use strict";
  var alph_index, comprise_str, i, comprise_list;
  alph_index = this.encode[letter];
  if (typeof alph_index === "undefined") {
    throw new Error("Unknown letter");
  }
  comprise_str = this.symbols[alph_index].equals;
  comprise_list = [];
  if (typeof comprise_str == "string") {
    for (i = 0; i < comprise_str.length; i++) {
      comprise_list.push(this.encode2core[comprise_str.charAt(i)]);
    }
  } else {
    comprise_list.push(alph_index);
  }
  return comprise_list;
};
// check if a symbol is the primary way of representing the symbol in the alphabet
Alphabet.prototype.is_prime_symbol = function(letter) {
  var alph_index;
  alph_index = this.encode[letter];
  if (alph_index == null) return false;
  if (this.is_case_insensitive()) {
    return (this.symbols[alph_index].symbol.toUpperCase() == letter.toUpperCase());
  } else {
    return (this.symbols[alph_index].symbol == letter);
  }
};
// compare 2 alphabets
Alphabet.prototype.equals = function(other) {
  "use strict";
  var i, sym1, sym2;
  // first check that it's actually an alphabet object
  if (!(typeof other === "object" && other != null && other instanceof Alphabet)) {
    return false;
  }
  // second shortcircuit if it's the same object
  if (this === other) return true;
  // compare
  if (this.name !== other.name) return false;
  if (this.ncore !== other.ncore) return false;
  if (this.symbols.length !== other.symbols.length) return false;
  for (i = 0; i < this.symbols.length; i++) {
    sym1 = this.symbols[i];
    sym2 = other.symbols[i];
    if (sym1.symbol !== sym2.symbol) return false;
    if (sym1.aliases !== sym2.aliases) return false;
    if (sym1.name !== sym2.name) return false;
    if (typeof sym1.colour !== typeof sym2.colour || 
        (typeof sym1.colour === "string" && typeof sym2.colour === "string" &&
         parseInt(sym1.colour, 16) != parseInt(sym2.colour, 16))) {
      return false;
    }
    if (sym1.complement !== sym2.complement) return false;
    if (sym1.equals !== sym2.equals) return false;
  }
  return true;
};
Alphabet.prototype.check_core_subset = function(super_alph) {
  var complement_same = true;
  var seen_set = {};
  var sub_i, sub_symbol, super_i, super_symbol;
  for (sub_i = 0; sub_i < this.ncore; sub_i++) {
    sub_symbol = this.symbols[sub_i];
    super_i = super_alph.encode[sub_symbol.symbol]; 
    if (super_i == null) return 0;
    super_symbol = super_alph.symbols[super_i];
    if (seen_set[super_i]) return 0;
    seen_set[super_i] = true;
    // check complement
    if (sub_symbol.complement != null && super_symbol.complement != null) {
      if (super_alph.encode[sub_symbol.complement] != super_alph.encode[super_symbol.complement]) {
        complement_same = false;
      }
    } else if (sub_symbol.complement != null || super_symbol.complement != null) {
      complement_same = false;
    }
  }
  return (complement_same ? 1 : -1);
};
// convert a sequence to its reverse complement
Alphabet.prototype.invcomp_seq = function(seq) {
  "use strict";
  var syms, i, e_sym, comp_e_sym;
  if (!this.has_complement()) throw new Error("Alphabet must be complementable");
  syms = seq.split("");
  for (i = 0; i < syms.length; i++) {
    e_sym = this.encode[syms[i]];
    if (typeof e_sym === "undefined") {
      e_sym = this.ncore; // wildcard
    }
    comp_e_sym = this.complement[e_sym];
    if (typeof comp_e_sym === "undefined") {
      comp_e_sym = e_sym; // not complementable
    }
    syms[i] = this.symbols[comp_e_sym].symbol;
  }
  return syms.reverse().join("");
};
// convert the alphabet to the text version
Alphabet.prototype.as_text = function() {
  "use strict";
  function name_as_text(name) {
    var i, c, out;
    out = "\"";
    for (i = 0; i < name.length; i++) {
      c = name.charAt(i);
      if (c == "\"") {
        out += "\\\"";
      } else if (c == "/") {
        out += "\\/";
      } else if (c == "\\") {
        out += "\\\\";
      } else {
        out += c;
      }
    }
    out += "\"";
    return out;
  }
  function symbol_as_text(sym) {
    var out;
    out = sym.symbol;
    if (typeof sym.name === "string" && sym.name != sym.symbol) {
      out += " " + name_as_text(sym.name);
    }
    if (typeof sym.colour === "string") {
      out += " " + sym.colour;
    }
    return out;
  }
  var out, i, j, c, sym;
  out = "";
  // output core symbols with 2 way complements
  for (i = 0; i < this.ncore; i++) {
    c = this.complement[i];
    if (typeof c === "number" && i < c && this.complement[c] === i) {
      out += symbol_as_text(this.symbols[i]) + " ~ " + symbol_as_text(this.symbols[c]) + "\n";  
    }
  }
  // output core symbols with no complement
  for (i = 0; i < this.ncore; i++) {
    if (typeof this.complement[i] === "undefined") {
      out += symbol_as_text(this.symbols[i]) + "\n";
    }
  }
  // output ambiguous symbols that have comprising characters
  for (i = this.ncore; i < this.symbols.length; i++) {
    if (this.symbols[i].equals.length == 0) break;
    out += symbol_as_text(this.symbols[i]) + " = " + this.symbols[i].equals + "\n";
    if (typeof this.symbols[i].aliases === "string") {
      for (j = 0; j < this.symbols[i].aliases.length; j++) {
        if (this.symbols[i].aliases.charAt(j) == this.symbols[i].symbol) continue;
        out += this.symbols[i].aliases.charAt(j) + " = " + this.symbols[i].equals + "\n";
      }
    }
  }
  // output aliases of core symbols
  for (i = 0; i < this.ncore; i++) {
    if (typeof this.symbols[i].aliases === "string") {
      for (j = 0; j < this.symbols[i].aliases.length; j++) {
        if (this.symbols[i].aliases.charAt(j) == this.symbols[i].symbol) continue;
        out += this.symbols[i].aliases.charAt(j) + " = " + this.symbols[i].symbol + "\n";
      }
    }
  }
  // output gap symbols
  i = this.symbols.length - 1;
  if (this.symbols[i].equals.length == 0) {
    out += symbol_as_text(this.symbols[i]) + " =\n";
    if (typeof this.symbols[i].aliases === "string") {
      for (j = 0; j < this.symbols[i].aliases.length; j++) {
        if (this.symbols[i].aliases.charAt(j) == this.symbols[i].symbol) continue;
        out += this.symbols[i].aliases.charAt(j) + " =\n";
      }
    }
  }
  return out;
};
// output the alphabet as it appears in minimal MEME format
Alphabet.prototype.as_meme = function() {
  "use strict";
  function name_as_text(name) {
    var i, c, out;
    out = "\"";
    for (i = 0; i < name.length; i++) {
      c = name.charAt(i);
      if (c == "\"") {
        out += "\\\"";
      } else if (c == "/") {
        out += "\\/";
      } else if (c == "\\") {
        out += "\\\\";
      } else {
        out += c;
      }
    }
    out += "\"";
    return out;
  }
  if (this.equals(AlphStd.DNA)) {
    return "ALPHABET= ACGT\n";
  } else if (this.equals(AlphStd.PROTEIN)) {
    return "ALPHABET= ACDEFGHIKLMNPQRSTVWY\n";
  } else {
    return "ALPHABET" + 
      (this.name != null ? " " + name_as_text(this.name) : "") + 
      (this.like != null ? " " + this.like + "-LIKE" : "") + "\n" +
      this.as_text() + "END ALPHABET\n";
  }
};

// Returns a table showing all the letters in the alphabet
Alphabet.prototype.as_table = function() {
  "use strict";
  var i, j, row, th, td, aliases, equals, sym;
  var table = document.createElement("table");
  // create the core symbol header
  row = table.insertRow(table.rows.length);
  th = document.createElement("th");
  th.appendChild(document.createTextNode("Symbol(s)"));
  row.appendChild(th);
  th = document.createElement("th");
  th.appendChild(document.createTextNode("Name"));
  row.appendChild(th);
  th = document.createElement("th");
  if (this.has_complement()) {
    th.appendChild(document.createTextNode("Complement"));
  }
  row.appendChild(th);
  // list the core symbols
  for (i = 0; i < this.ncore; i++) {
    row = table.insertRow(table.rows.length);
    td = document.createElement("td");
    if (this.symbols[i].colour != null) {
      td.style.color = '#' + this.symbols[i].colour;
    }
    td.appendChild(document.createTextNode(this.symbols[i].symbol));
    aliases = this.get_aliases(i);
    if (aliases.length > 0) {
      td.appendChild(document.createTextNode(' ' + aliases.split('').join(' ')));
    }
    row.appendChild(td);
    td = document.createElement("td");
    if (this.symbols[i].name != null) {
      td.appendChild(document.createTextNode(this.symbols[i].name));
    }
    row.appendChild(td);
    td = document.createElement("td");
    if (this.symbols[i].complement != null) {
      td.style.color = this.get_colour(this.get_index(this.symbols[i].complement));
      td.appendChild(document.createTextNode(this.symbols[i].complement));
    }
    row.appendChild(td);
  }
  // create the ambiguous symbol header
  row = table.insertRow(table.rows.length);
  th = document.createElement("th");
  th.appendChild(document.createTextNode("Symbol(s)"));
  row.appendChild(th);
  th = document.createElement("th");
  th.appendChild(document.createTextNode("Name"));
  row.appendChild(th);
  th = document.createElement("th");
  th.appendChild(document.createTextNode("Matches"));
  row.appendChild(th);
  // list the ambiguous symbols
  for (i = this.ncore; i < this.symbols.length; i++) {
    row = table.insertRow(table.rows.length);
    td = document.createElement("td");
    if (this.symbols[i].colour != null) {
      td.style.color = '#' + this.symbols[i].colour;
    }
    td.appendChild(document.createTextNode(this.symbols[i].symbol));
    aliases = this.get_aliases(i);
    if (aliases.length > 0) {
      td.appendChild(document.createTextNode(' ' + aliases.split('').join(' ')));
    }
    row.appendChild(td);
    td = document.createElement("td");
    if (this.symbols[i].name != null) {
      td.appendChild(document.createTextNode(this.symbols[i].name));
    }
    row.appendChild(td);
    td = document.createElement("td");
    equals = this.symbols[i].equals.split('');
    for (j = 0; j < equals.length; j++) {
      if (j != 0) td.appendChild(document.createTextNode(' '));
      sym = document.createElement("span");
      sym.style.color = this.get_colour(this.get_index(equals[j]));
      sym.appendChild(document.createTextNode(equals[j]));
      td.appendChild(sym);
    }
    row.appendChild(td);
  }
  return table;
};

// returns a dictionary of the colours for EPS
Alphabet.prototype._as_eps_dict = function() {
  "use strict";
  var i, sym, rgb;
  var out = "/fullColourDict <<\n";
  for (i = 0; i < this.ncore; i++) {
    sym = this.get_symbol(i);
    sym = sym.replace(/\\/g, "\\\\");
    sym = sym.replace(/\(/g, "\\(");
    sym = sym.replace(/\)/g, "\\)");
    rgb = this.get_rgb(i);
    out += " (" + sym + ") [" + rgb.red.toFixed(4) + " " + rgb.green.toFixed(4) + " " + rgb.blue.toFixed(4) + "]\n";
  }
  out += ">> def\n";
  out += "/mutedColourDict <<\n";
  for (i = 0; i < this.ncore; i++) {
    sym = this.get_symbol(i);
    sym = sym.replace(/\\/g, "\\\\");
    sym = sym.replace(/\(/g, "\\(");
    sym = sym.replace(/\)/g, "\\)");
    rgb = Alphabet.lighten_colour(this.get_rgb(i));
    out += " (" + sym + ") [" + rgb.red.toFixed(4) + " " + rgb.green.toFixed(4) + " " + rgb.blue.toFixed(4) + "]\n";
  }
  out += ">> def\n";
  return out;
};

// return the alphabet name or a list of primary symbols
Alphabet.prototype.toString = function() {
  "use strict";
  if (this.name != null) {
    return this.name;
  } else {
    return this.get_symbols();
  }
};

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Helper functions
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

// Convert a colour specified in RGB colourspace values into LAB colourspace
Alphabet.rgb2lab = function(rgb) {
  "use strict";
  var xyzHelper, labHelper;
  // XYZ helper
  xyzHelper = function(value) {
    if (value > 0.0445) {
      value = (value + 0.055) / 1.055;
      value = Math.pow(value, 2.4);
    } else {
      value /= 12.92;
    }
    value *= 100;
    return value;
  };
  // lab helper
  labHelper = function(value) {
    if (value > 0.008856) {
      value = Math.pow(value, 1.0 / 3.0);
    } else {
      value = (7.787 * value) + (16.0 / 116.0);
    }
    return value;
  };
  // convert into XYZ colourspace
  var c1, c2, c3;
  if (typeof rgb == "number") {
    c1 = xyzHelper(((rgb >> 16) & 0xFF) / 255.0);
    c2 = xyzHelper(((rgb >> 8) & 0xFF) / 255.0);
    c3 = xyzHelper((rgb & 0xFF) / 255.0);
  } else {
    c1 = xyzHelper(rgb.red);
    c2 = xyzHelper(rgb.green);
    c3 = xyzHelper(rgb.blue);
  }
  var x = (c1 * 0.4124) + (c2 * 0.3576) + (c3 * 0.1805);
  var y = (c1 * 0.2126) + (c2 * 0.7152) + (c3 * 0.0722);
  var z = (c1 * 0.0193) + (c2 * 0.1192) + (c3 * 0.9505);
  // convert into Lab colourspace
  c1 = labHelper(x / 95.047);
  c2 = labHelper(y / 100.0);
  c3 = labHelper(z / 108.883);
  var l = (116.0 * c2) - 16;
  var a = 500.0 * (c1 - c2);
  var b = 200.0 * (c2 - c3);
  return {"l": l, "a": a, "b": b};
};

// Convert a colour specified in HSV colourspace into RGB colourspace
Alphabet.hsv2rgb = function(hue, sat, value, output_object) {
  // achromatic (grey)
  var r = value;
  var g = value;
  var b = value;
  if (sat != 0) {
    var h = hue / 60.0;
    var i = Math.floor(h);
    var f = h - i;
    var p = value * (1.0 - sat);
    var q = value * (1.0 - (sat * f));
    var t = value * (1.0 - (sat * (1.0 - f)));
    if (i == 0) {
      r = value;
      g = t;
      b = p;
    } else if (i == 1) {
      r = q;
      g = value;
      b = p;
    } else if (i == 2) {
      r = p;
      g = value;
      b = t;
    } else if (i == 3) {
      r = p;
      g = q;
      b = value;
    } else if (i == 4) {
      r = t;
      g = p;
      b = value;
    } else {
      r = value;
      g = p;
      b = q;
    }
  }
  if (output_object) {
    return {"red": r, "green": g, "blue": b};
  } else {
    return (Math.floor(r * 255) << 15) | (Math.floor(g * 255) << 8) | (Math.floor(b * 255));
  }
};

// Calculate a distance score between two colours in LAB colourspace
Alphabet.lab_dist = function(lab1, lab2) {
  var c1 = Math.sqrt((lab1.l * lab1.l) + (lab1.a * lab1.a));
  var c2 = Math.sqrt((lab2.l * lab2.l) + (lab2.a * lab2.a));
  var dc = c1 - c2;
  var dl = lab1.l - lab2.l;
  var da = lab1.a - lab2.a;
  var db = lab1.b - lab2.b;
  // we don't want NaN due to rounding errors so fudge things a bit...
  var dh = 0;
  var dh_squared = (da * da) + (db * db) - (dc * dc);
  if (dh_squared > 0) {
    dh = Math.sqrt(dh_squared);
  }
  var first = dl;
  var second = dc / (1.0 + (0.045 * c1));
  var third = dh / (1.0 + (0.015 * c1));
  return Math.sqrt((first * first) + (second * second) + (third * third));
};

// convert an RGB value into a HSL value
Alphabet.rgb2hsl = function(rgb) {
  "use strict";
  var min, max, delta, h, s, l, r, g, b;
  if (typeof rgb == "number") {
    r = ((rgb >> 16) & 0xFF) / 255.0;
    g = ((rgb >> 8) & 0xFF) / 255.0;
    b = (rgb & 0xFF) / 255.0;
  } else {
    r = rgb.red;
    g = rgb.green;
    b = rgb.blue;
  }
  min = Math.min(r, g, b);
  max = Math.max(r, g, b);
  delta = max - min;
  l = min + (delta / 2);
  if (max == min) {
    h = 0; // achromatic (grayscale)
    s = 0;
  } else {
    if (l > 0.5) {
      s = delta / (2 - max - min);
    } else {
      s = delta / (max + min);
    }
    if (max == r) {
      h = (g - b) / delta;
      if (g < b) h += 6;
    } else if (max == g) {
      h = ((b - r) / delta) + 2;
    } else {
      h = ((r - g) / delta) + 4;
    }
    h /= 6;
  }
  return {"h": h, "s": s, "l": l};
};

// convert a HSL value into an RGB value
Alphabet.hsl2rgb = function(hsl, output_object) {
  "use strict";
  function _hue(p, q, t) {
    "use strict";
    if (t < 0) t += 1;
    else if (t > 1) t -= 1;
    if (t < (1.0 / 6.0)) {
      return p + ((q - p) * 6.0 * t);
    } else if (t < 0.5) {
      return q;
    } else if (t < (2.0 / 3.0)) {
      return p + ((q - p) * ((2.0 / 3.0) - t) * 6.0);
    } else {
      return p;
    }
  }
  var r, g, b, p, q;
  if (hsl.s == 0) {
    // achromatic (grayscale)
    r = hsl.l;
    g = hsl.l;
    b = hsl.l;
  } else {
    if (hsl.l < 0.5) {
      q = hsl.l * (1 + hsl.s);
    } else {
      q = hsl.l + hsl.s - (hsl.l * hsl.s);
    }
    p = (2 * hsl.l) - q;
    r = _hue(p, q, hsl.h + (1.0 / 3.0));
    g = _hue(p, q, hsl.h);
    b = _hue(p, q, hsl.h - (1.0 / 3.0));
  }
  if (output_object) {
    return {"red": r, "green": g, "blue": b};
  } else {
    return (Math.floor(r * 255) << 15) | (Math.floor(g * 255) << 8) | (Math.floor(b * 255));
  }
};

Alphabet.lighten_colour = function(rgb) {
  "use strict";
  var hsl = Alphabet.rgb2hsl(rgb);
  hsl.l += (1.0 - hsl.l) * 2 / 3;
  return Alphabet.hsl2rgb(hsl, typeof rgb != "number");
};

//======================================================================
// end Alphabet object
//======================================================================

//======================================================================
// start StandardAlphabet object
//======================================================================

// an extension of the alphabet object to support some additional fields 
// only present in standard alphabets.
var StandardAlphabet = function(enum_code, enum_name, alphabet_data) {
  Alphabet.apply(this, [alphabet_data]);
  this.enum_code = enum_code;
  this.enum_name = enum_name;
};
StandardAlphabet.prototype = Alphabet.prototype;
StandardAlphabet.prototype.constructor = StandardAlphabet;

// A unique code for this standard alphabet.
// This code will be a power of 2 to enable creation of bitsets for
// a selection of standard alphabets.
StandardAlphabet.prototype.get_code = function() {
  return this.enum_code;
};

// A unique name for this standard alphabet.
// this name will be all upper case and the same as the property that
// refers to this alphabet in the AlphStd collection.
StandardAlphabet.prototype.get_enum = function() {
  return this.enum_name;
};

//======================================================================
// end StandardAlphabet object
//======================================================================

// A collection of standard alphabets.
var AlphStd = {
  RNA: new StandardAlphabet(1, "RNA", {
    "name": "RNA",
    "like": "RNA",
    "ncore": 4,
    "symbols": [
      {"symbol": "A", "name": "Adenine", "colour": "CC0000"},
      {"symbol": "C", "name": "Cytosine", "colour": "0000CC"},
      {"symbol": "G", "name": "Guanine", "colour": "FFB300"},
      {"symbol": "U", "name": "Uracil", "colour": "008000",
        "aliases": "T"},
      {"symbol": "N", "name": "Any base", "equals": "ACGU", "aliases": "X."},
      {"symbol": "V", "name": "Not U", "equals": "ACG"},
      {"symbol": "H", "name": "Not G", "equals": "ACU"},
      {"symbol": "D", "name": "Not C", "equals": "AGU"},
      {"symbol": "B", "name": "Not A", "equals": "CGU"},
      {"symbol": "M", "name": "Amino", "equals": "AC"},
      {"symbol": "R", "name": "Purine", "equals": "AG"},
      {"symbol": "W", "name": "Weak", "equals": "AU"}, 
      {"symbol": "S", "name": "Strong", "equals": "CG"},
      {"symbol": "Y", "name": "Pyrimidine", "equals": "CU"},
      {"symbol": "K", "name": "Keto", "equals": "GU"}
    ]
  }), 
  DNA: new StandardAlphabet(2, "DNA", {
    "name": "DNA",
    "like": "DNA",
    "ncore": 4,
    "symbols": [
      {"symbol": "A", "name": "Adenine", "colour": "CC0000", "complement": "T"},
      {"symbol": "C", "name": "Cytosine", "colour": "0000CC", "complement": "G"},
      {"symbol": "G", "name": "Guanine", "colour": "FFB300", "complement": "C"},
      {"symbol": "T", "name": "Thymine", "colour": "008000", "complement": "A",
        "aliases": "U"},
      {"symbol": "N", "name": "Any base", "equals": "ACGT", "aliases": "X."},
      {"symbol": "V", "name": "Not T", "equals": "ACG"},
      {"symbol": "H", "name": "Not G", "equals": "ACT"},
      {"symbol": "D", "name": "Not C", "equals": "AGT"},
      {"symbol": "B", "name": "Not A", "equals": "CGT"},
      {"symbol": "M", "name": "Amino", "equals": "AC"},
      {"symbol": "R", "name": "Purine", "equals": "AG"},
      {"symbol": "W", "name": "Weak", "equals": "AT"}, 
      {"symbol": "S", "name": "Strong", "equals": "CG"},
      {"symbol": "Y", "name": "Pyrimidine", "equals": "CT"},
      {"symbol": "K", "name": "Keto", "equals": "GT"}
    ]
  }), 
  PROTEIN: new StandardAlphabet(4, "PROTEIN", {
    "name": "Protein",
    "like": "PROTEIN",
    "ncore": 20,
    "symbols": [
      {"symbol": "A", "name": "Alanine", "colour": "0000CC"},
      {"symbol": "C", "name": "Cysteine", "colour": "0000CC"},
      {"symbol": "D", "name": "Aspartic acid", "colour": "FF00FF"},
      {"symbol": "E", "name": "Glutamic acid", "colour": "FF00FF"},
      {"symbol": "F", "name": "Phenylalanine", "colour": "0000CC"},
      {"symbol": "G", "name": "Glycine", "colour": "FFB300"},
      {"symbol": "H", "name": "Histidine", "colour": "FFCCCC"},
      {"symbol": "I", "name": "Isoleucine", "colour": "0000CC"},
      {"symbol": "K", "name": "Lysine", "colour": "CC0000"},
      {"symbol": "L", "name": "Leucine", "colour": "0000CC"},
      {"symbol": "M", "name": "Methionine", "colour": "0000CC"},
      {"symbol": "N", "name": "Asparagine", "colour": "008000"},
      {"symbol": "P", "name": "Proline", "colour": "FFFF00"},
      {"symbol": "Q", "name": "Glutamine", "colour": "008000"},
      {"symbol": "R", "name": "Arginine", "colour": "CC0000"},
      {"symbol": "S", "name": "Serine", "colour": "008000"},
      {"symbol": "T", "name": "Threonine", "colour": "008000"},
      {"symbol": "V", "name": "Valine", "colour": "0000CC"},
      {"symbol": "W", "name": "Tryptophan", "colour": "0000CC"},
      {"symbol": "Y", "name": "Tyrosine", "colour": "33E6CC"},
      {"symbol": "X", "name": "Any amino acid", "equals": "ACDEFGHIKLMNPQRSTVWY", "aliases": "*."},
      {"symbol": "B", "name": "Asparagine or Aspartic acid", "equals": "DN"}, 
      {"symbol": "Z", "name": "Glutamine or Glutamic acid", "equals": "EQ"}, 
      {"symbol": "J", "name": "Leucine or Isoleucine", "equals": "IL"}
    ]
  })
};

//======================================================================
// start Symbol object
//======================================================================
var Symbol = function(alph_index, scale, alphabet) {
  "use strict";
  //variable prototype
  this.symbol = alphabet.get_symbol(alph_index);
  this.scale = scale;
  this.colour = alphabet.get_colour(alph_index);
};

Symbol.prototype.get_symbol = function() {
  "use strict";
  return this.symbol;
};

Symbol.prototype.get_scale = function() {
  "use strict";
  return this.scale;
};

Symbol.prototype.get_colour = function() {
  "use strict";
  return this.colour;
};

Symbol.prototype.toString = function() {
  "use strict";
  return this.symbol + " " + (Math.round(this.scale*1000)/10) + "%";
};

function compare_symbol(sym1, sym2) {
  "use strict";
  if (sym1.get_scale() < sym2.get_scale()) {
    return -1;
  } else if (sym1.get_scale() > sym2.get_scale()) {
    return 1;
  } else {
    return 0;
  }
}
//======================================================================
// end Symbol object
//======================================================================

//======================================================================
// start Pspm object
//======================================================================
var Pspm = function(matrix, name, ltrim, rtrim, nsites, evalue, pssm, alt) {
  "use strict";
  var row, col, data, row_sum, delta, evalue_re;
  if (typeof name !== "string") {
    name = "";
  }
  this.name = name;
  //construct
  if (matrix instanceof Pspm) {
    // copy constructor
    this.alph_length = matrix.alph_length;
    this.motif_length = matrix.motif_length;
    this.name = matrix.name;
    this.alt = matrix.alt;
    this.nsites = matrix.nsites;
    this.evalue = matrix.evalue;
    this.ltrim = matrix.ltrim;
    this.rtrim = matrix.rtrim;
    this.pspm = [];
    for (row = 0; row < matrix.motif_length; row++) {
      this.pspm[row] = [];
      for (col = 0; col < matrix.alph_length; col++) {
        this.pspm[row][col] = matrix.pspm[row][col];
      }
    }
    if (matrix.pssm != null) {
      this.pssm = [];
      for (row = 0; row < matrix.motif_length; row++) {
        this.pspm[row] = [];
        for (col = 0; col < matrix.alph_length; col++) {
          this.pssm[row][col] = matrix.pssm[row][col];
        }
      }
    }
  } else {
    // check parameters
    if (ltrim == null) {
      ltrim = 0;
    } else if (typeof ltrim !== "number" || ltrim % 1 !== 0 || ltrim < 0) {
      throw new Error("ltrim must be a non-negative integer, got: " + ltrim);
    }
    if (rtrim == null) {
      rtrim = 0;
    } else if (typeof rtrim !== "number" || rtrim % 1 !== 0 || rtrim < 0) {
      throw new Error("rtrim must be a non-negative integer, got: " + rtrim);
    }
    if (nsites != null) {
      if (typeof nsites !== "number" || nsites < 0) {
        throw new Error("nsites must be a positive number, got: " + nsites);
      } else if (nsites == 0) {
        nsites = null;
      }
    }
    if (evalue != null) {
      if (typeof evalue === "number") {
        if (evalue < 0) {
          throw new Error("evalue must be a non-negative number, got: " + evalue);
        }
      } else if (typeof evalue === "string") {
        evalue_re = /^((?:[+]?[0-9]*\.?[0-9]+(?:[eE][-+]?[0-9]+)?)|inf)$/;
        if (!evalue_re.test(evalue)) {
          throw new Error("evalue must be a non-negative number, got: " + evalue);
        }
      } else {
        throw new Error("evalue must be a non-negative number, got: " + evalue);
      }
    }
    // set properties
    this.name = name;
    this.alt = alt;
    this.nsites = nsites;
    this.evalue = evalue;
    this.ltrim = ltrim;
    this.rtrim = rtrim;
    if (typeof matrix === "string") {
      // string constructor
      data = parse_pspm_string(matrix);
      this.alph_length = data["alph_length"];
      this.motif_length = data["motif_length"];
      this.pspm = data["pspm"];
      if (this.evalue == null) {
        if (data["evalue"] != null) {
          this.evalue = data["evalue"];
        } else {
          this.evalue = 0;
        }
      }
      if (this.nsites == null) {
        if (typeof data["nsites"] === "number") {
          this.nsites = data["nsites"];
        } else {
          this.nsites = 20;
        }
      }
    } else {
      // assume pspm is a nested array
      this.motif_length = matrix.length;
      this.alph_length = (matrix.length > 0 ? matrix[0].length : 0);
      if (this.nsites == null) {
        this.nsites = 20;
      }
      if (this.evalue == null) {
        this.evalue = 0;
      }
      this.pspm = [];
      // copy pspm and check
      for (row = 0; row < this.motif_length; row++) {
        if (this.alph_length != matrix[row].length) {
          throw new Error("COLUMN_MISMATCH");
        }
        this.pspm[row] = [];
        row_sum = 0;
        for (col = 0; col < this.alph_length; col++) {
          this.pspm[row][col] = matrix[row][col];
          row_sum += this.pspm[row][col];
        }
        delta = 0.1;
        if (isNaN(row_sum) || (row_sum > 1 && (row_sum - 1) > delta) || 
            (row_sum < 1 && (1 - row_sum) > delta)) {
          throw new Error("INVALID_SUM");
        }
      }
      // copy pssm
      if (pssm != null) {
        this.pssm = [];
        for (row = 0; row < this.motif_length; row++) {
          this.pssm[row] = [];
          for (col = 0; col < this.alph_length; col++) {
            this.pssm[row][col] = pssm[row][col];
          }
        }
      }
    }
  }
};

Pspm.prototype.copy = function() {
  "use strict";
  return new Pspm(this);
};

Pspm.prototype.reverse = function() {
  "use strict";
  var x, y, temp, temp_trim;
  //reverse
  x = 0;
  y = this.motif_length-1;
  while (x < y) {
    temp = this.pspm[x];
    this.pspm[x] = this.pspm[y];
    this.pspm[y] = temp;
    x++;
    y--;
  }
  // reverse pssm (if defined)
  if (typeof this.pssm !== "undefined") {
    //reverse
    x = 0;
    y = this.motif_length-1;
    while (x < y) {
      temp = this.pssm[x];
      this.pspm[x] = this.pssm[y];
      this.pssm[y] = temp;
      x++;
      y--;
    }
  }
  //swap triming
  temp_trim = this.ltrim;
  this.ltrim = this.rtrim;
  this.rtrim = temp_trim;
  return this; //allow function chaining...
};

Pspm.prototype.reverse_complement = function(alphabet) {
  "use strict";
  var x, y, temp, i, row, c, temp_trim;
  if (this.alph_length != alphabet.get_size_core()) {
    throw new Error("The alphabet size does not match the size of the pspm.");
  }
  if (!alphabet.has_complement()) {
    throw new Error("The specified alphabet can not be complemented.");
  }
  // reverse motif
  this.reverse();
  //complement
  for (x = 0; x < this.motif_length; x++) {
    row = this.pspm[x];
    for (i = 0; i < row.length; i++) {
      c = alphabet.get_complement(i);
      if (c < i) continue;
      temp = row[i];
      row[i] = row[c];
      row[c] = temp;
    }
  }
  // complement pssm (if defined)
  if (typeof this.pssm !== "undefined") {
    //complement
    for (x = 0; x < this.motif_length; x++) {
      row = this.pssm[x];
      for (i = 0; i < row.length; i++) {
        c = alphabet.get_complement(i);
        if (c < i) continue;
        temp = row[i];
        row[i] = row[c];
        row[c] = temp;
      }
    }
  }
  return this; //allow function chaining...
};

Pspm.prototype.get_stack = function(position, alphabet, ssc) {
  "use strict";
  var row, stack_ic, alphabet_ic, stack, i, sym;
  if (this.alph_length != alphabet.get_size_core()) {
    throw new Error("The alphabet size does not match the size of the pspm.");
  }
  row = this.pspm[position];
  stack_ic = this.get_stack_ic(position, alphabet);
  if (ssc) stack_ic -= this.get_error(alphabet);
  alphabet_ic = alphabet.get_ic();
  stack = [];
  for (i = 0; i < this.alph_length; i++) {
    sym = new Symbol(i, row[i]*stack_ic/alphabet_ic, alphabet);
    if (sym.get_scale() <= 0) {
      continue;
    }
    stack.push(sym);
  }
  stack.sort(compare_symbol);
  return stack;
};

Pspm.prototype.get_stack_ic = function(position, alphabet) {
  "use strict";
  var row, H, i;
  if (this.alph_length != alphabet.get_size_core()) {
    throw new Error("The alphabet size does not match the size fo the pspm.");
  }
  row = this.pspm[position];
  H = 0;
  for (i = 0; i < this.alph_length; i++) {
    if (row[i] === 0) {
      continue;
    }
    H -= (row[i] * (Math.log(row[i]) / Math.LN2));
  }
  return alphabet.get_ic() - H;
};

Pspm.prototype.get_error = function(alphabet) {
  "use strict";
  if (this.nsites === 0) {
    return 0;
  }
  return (alphabet.get_size_core()-1) / (2 * Math.LN2 * this.nsites);
};

Pspm.prototype.get_motif_length = function() {
  "use strict";
  return this.motif_length;
};

Pspm.prototype.get_alph_length = function() {
  "use strict";
  return this.alph_length;
};

Pspm.prototype.get_left_trim = function() {
  "use strict";
  return this.ltrim;
};

Pspm.prototype.get_right_trim = function() {
  "use strict";
  return this.rtrim;
};

Pspm.prototype.as_best_match = function(alphabet) {
  "use strict";
  var match, odds, best_odds, best_index;
  var i, j;
  match = "";
  for (i = 0; i < this.motif_length; i++) {
    best_index = 0;
    best_odds = this.pspm[i][0] / alphabet.get_bg_freq(0);
    for (j = 1; j < this.alph_length; j++) {
      odds = this.pspm[i][j] / alphabet.get_bg_freq(j);
      if (odds > best_odds) {
        best_odds = odds;
        best_index = j;
      }
    }
    match += alphabet.get_symbol(best_index);
  }
  return match;
};

Pspm.prototype.as_count_matrix = function() {
  "use strict";
  var count, count_text, text;
  var i, j;
  text = "";
  for (i = 0; i < this.motif_length; i++) {
    if (i !== 0) {
      text += "\n";
    }
    for (j = 0; j < this.alph_length; j++) {
      if (j !== 0) {
        text += " ";
      }
      count = Math.round(this.nsites * this.pspm[i][j]);
      count_text = "" + count;
      // pad up to length of 4
      if (count_text.length < 4) {
        text += (new Array(5 - count_text.length)).join(" ") + count_text;
      } else {
        text += count_text;
      }
    }
  }
  return text; 
};

Pspm.prototype.as_probability_matrix = function() {
  "use strict";
  var text;
  var i, j;
  text = "";
  for (i = 0; i < this.motif_length; i++) {
    if (i !== 0) {
      text += "\n";
    }
    for (j = 0; j < this.alph_length; j++) {
      if (j !== 0) {
        text += " ";
      }
      text += this.pspm[i][j].toFixed(6);
    }
  }
  return text; 
};

Pspm.prototype.as_score_matrix = function(alphabet, pseudo) {
  "use strict";
  var me, score, out, row, col, score_text;
  me = this;
  if (typeof this.pssm === "undefined") {
    if (!(typeof alphabet === "object" && alphabet != null && alphabet instanceof Alphabet)) {
      throw new Error("The alphabet is required to generate the pssm.");
    }
    if (typeof pseudo === "undefined") {
      pseudo = 0.01;
    } else if (typeof pseudo !== "number" || pseudo < 0) {
      throw new Error("Expected positive number for pseudocount");
    }
    score = function(row, col) {
      "use strict";
      var p, bg, p2;
      p = me.pspm[row][col];
      bg = alphabet.get_bg_freq(col);
      p2 = (p * me.nsites + bg * pseudo) / (me.nsites + pseudo);
      return (p2 > 0 ? Math.round((Math.log(p2 / bg) / Math.LN2) * 100) : -10000);
    };
  } else {
    score = function(row, col) {
      "use strict";
      return me.pssm[row][col];
    };
  }
  out = "";
  for (row = 0; row < this.motif_length; row++) {
    for (col = 0; col < this.alph_length; col++) {
      if (col !== 0) {
        out += " ";
      }
      score_text = "" + score(row, col);
      // pad out to 6 characters
      if (score_text.length < 6) {
        out += (new Array(7 - score_text.length)).join(" ") + score_text;
      } else {
        out += score_text;
      }
    }
    out += "\n";
  }
  return out;
}

Pspm.prototype.as_pspm = function() {
  "use strict";
  return "letter-probability matrix: alength= " + this.alph_length + 
      " w= " + this.motif_length + " nsites= " + this.nsites + 
      " E= " + (typeof this.evalue === "number" ? 
          this.evalue.toExponential() : this.evalue) + "\n" +
      this.as_probability_matrix();
};

Pspm.prototype.as_pssm = function(alphabet, pseudo) {
  "use strict";
  return "log-odds matrix: alength= " + this.alph_length + 
      " w= " + this.motif_length + 
      " E= " + (typeof this.evalue == "number" ?
          this.evalue.toExponential() : this.evalue) + "\n" +
      this.as_score_matrix(alphabet, pseudo);
};

Pspm.prototype.as_meme = function(options) {
  var with_header, with_pspm, with_pssm, version, alphabet, bg_source, pseudocount, strands;
  var out, alen, i;
  // get the options
  if (typeof options !== "object" || options === null) {
    options = {};
  }
  with_header = (typeof options["with_header"] === "boolean" ? options["with_header"] : false);
  with_pspm = (typeof options["with_pspm"] === "boolean" ? options["with_pspm"] : false);
  with_pssm = (typeof options["with_pssm"] === "boolean" ? options["with_pssm"] : false);
  if (!with_pspm && !with_pssm) with_pspm = true;
  if (with_header) {
    if (typeof options["version"] === "string" && /^\d+(?:\.\d+){0,2}$/.test(options["version"])) {
      version = options["version"];
    } else if (typeof options["version"] === "number") {
      version = options["version"].toFixed(0);
    } else {
      version = "4";
    }
    if (typeof options["strands"] === "number" && options["strands"] === 1) {
      strands = 1;
    } else {
      strands = 2;
    }
    if (typeof options["bg_source"] === "string") {
      bg_source = options["bg_source"];
    } else {
      bg_source = "unknown source";
    }
    if (typeof options["alphabet"] === "object" && options["alphabet"] != null
        && options["alphabet"] instanceof Alphabet) {
      alphabet = options["alphabet"];
    } else {
      throw new Error("The alphabet is required to generate the header.");
    }
  }
  // now create the output
  out = "";
  if (with_header) {
    out = "MEME version " + version + "\n\n";
    out += alphabet.as_meme() + "\n";
    if (alphabet.has_complement()) { // assume DNA has both strands unless otherwise specified
      out += "strands: " + (strands === 1 ? "+" : "+ -") + "\n\n";
    }
    out += "Background letter frequencies (from " + bg_source + "):\n";
    alen = alphabet.get_size_core();
    for (i = 0; i < alen; i++) {
      if (i !== 0) {
        if (i % 9 === 0) { // maximum of nine entries per line
          out += "\n";
        } else {
          out += " ";
        }
      }
      out += alphabet.get_symbol(i) + " " + alphabet.get_bg_freq(i).toFixed(3);
    }
  }
  out += "\n\n";
  out += "MOTIF " + this.name + (this.alt == null ? "" : " " + this.alt);
  if (with_pssm) {
    out += "\n\n";
    out += this.as_pssm(options["alphabet"], options["pseudocount"]);
  }
  if (with_pspm) {
    out += "\n\n";
    out += this.as_pspm();
  }
  return out;
}

Pspm.prototype.toString = function() {
  "use strict";
  var str, i, row;
  str = "";
  for (i = 0; i < this.pspm.length; i++) {
    row = this.pspm[i];
    str += row.join("\t") + "\n";
  }
  return str;
};

function parse_pspm_properties(str) {
  "use strict";
  var parts, i, eqpos, before, after, properties, prop, num, num_re;
  num_re = /^((?:[+]?[0-9]*\.?[0-9]+(?:[eE][-+]?[0-9]+)?)|inf)$/;
  parts = trim(str).split(/\s+/);
  // split up words containing =
  for (i = 0; i < parts.length;) {
    eqpos = parts[i].indexOf("=");
    if (eqpos != -1) {
      before = parts[i].substr(0, eqpos);
      after = parts[i].substr(eqpos+1);
      if (before.length > 0 && after.length > 0) {
        parts.splice(i, 1, before, "=", after);
        i += 3;
      } else if (before.length > 0) {
        parts.splice(i, 1, before, "=");
        i += 2;
      } else if (after.length > 0) {
        parts.splice(i, 1, "=", after);
        i += 2;
      } else {
        parts.splice(i, 1, "=");
        i++;
      }
    } else {
      i++;
    }
  }
  properties = {};
  for (i = 0; i < parts.length; i += 3) {
    if (parts.length - i < 3) {
      throw new Error("Expected PSPM property was incomplete. "+
          "Remaing parts are: " + parts.slice(i).join(" "));
    }
    if (parts[i+1] !== "=") {
      throw new Error("Expected '=' in PSPM property between key and " +
          "value but got " + parts[i+1]); 
    }
    prop = parts[i].toLowerCase();
    num = parts[i+2];
    if (!num_re.test(num)) {
      throw new Error("Expected numeric value for PSPM property '" + 
          prop + "' but got '" + num + "'");
    }
    properties[prop] = num;
  }
  return properties;
}

function parse_pspm_string(pspm_string) {
  "use strict";
  var header_re, lines, first_line, line_num, col_num, alph_length, 
      motif_length, nsites, evalue, pspm, i, line, match, props, parts,
      j, prob;
  header_re = /^letter-probability\s+matrix:(.*)$/i;
  lines = pspm_string.split(/\n/);
  first_line = true;
  line_num = 0;
  col_num = 0;
  alph_length;
  motif_length;
  nsites;
  evalue;
  pspm = [];
  for (i = 0; i < lines.length; i++) {
    line = trim(lines[i]);
    if (line.length === 0) { 
      continue;
    }
    // check the first line for a header though allow matrices without it
    if (first_line) {
      first_line = false;
      match = header_re.exec(line);
      if (match !== null) {
        props = parse_pspm_properties(match[1]);
        if (props.hasOwnProperty("alength")) {
          alph_length = parseFloat(props["alength"]);
          if (alph_length != 4 && alph_length != 20) {
            throw new Error("PSPM property alength should be 4 or 20" +
                " but got " + alph_length);
          }
        }
        if (props.hasOwnProperty("w")) {
          motif_length = parseFloat(props["w"]);
          if (motif_length % 1 !== 0 || motif_length < 1) {
            throw new Error("PSPM property w should be an integer larger " +
                "than zero but got " + motif_length);
          }
        }
        if (props.hasOwnProperty("nsites")) {
          nsites = parseFloat(props["nsites"]);
          if (nsites <= 0) {
            throw new Error("PSPM property nsites should be larger than " +
                "zero but got " + nsites);
          }
        }
        if (props.hasOwnProperty("e")) {
          evalue = props["e"];
          if (evalue < 0) {
            throw new Error("PSPM property evalue should be " +
                "non-negative but got " + evalue);
          }
        }
        continue;
      }
    }
    pspm[line_num] = [];
    col_num = 0;
    parts = line.split(/\s+/);
    for (j = 0; j < parts.length; j++) {
      prob = parseFloat(parts[j]);
      if (prob != parts[j] || prob < 0 || prob > 1) {
        throw new Error("Expected probability but got '" + parts[j] + "'"); 
      }
      pspm[line_num][col_num] = prob;
      col_num++;
    }
    line_num++;
  }
  if (typeof motif_length === "number") {
    if (pspm.length != motif_length) {
      throw new Error("Expected PSPM to have a motif length of " + 
          motif_length + " but it was actually " + pspm.length);
    }
  } else {
    motif_length = pspm.length;
  }
  if (typeof alph_length !== "number") {
    alph_length = pspm[0].length;
    if (alph_length != 4 && alph_length != 20) {
      throw new Error("Expected length of first row in the PSPM to be " +
          "either 4 or 20 but got " + alph_length);
    }
  }
  for (i = 0; i < pspm.length; i++) {
    if (pspm[i].length != alph_length) {
      throw new Error("Expected PSPM row " + i + " to have a length of " + 
          alph_length + " but the length was " + pspm[i].length);
    }
  }
  return {"pspm": pspm, "motif_length": motif_length, 
    "alph_length": alph_length, "nsites": nsites, "evalue": evalue};
}
//======================================================================
// end Pspm object
//======================================================================

//======================================================================
// start Logo object
//======================================================================

var Logo = function(alphabet, options) {
  "use strict";
  this.alphabet = alphabet;
  this.fine_text = "";
  this.x_axis = 1;
  this.y_axis = true;
  this.xlate_nsyms = 1;
  this.xlate_start = null;
  this.xlate_end = null;
  this.pspm_list = [];
  this.pspm_column = [];
  this.rows = 0;
  this.columns = 0;
  if (typeof options === "string") {
    // the old method signature had fine_text here so we support that
    this.fine_text = options;
  } else if (typeof options === "object" && options != null) {
    this.fine_text = (typeof options.fine_text === "string" ? options.fine_text : "");
    this.x_axis = (typeof options.x_axis === "boolean" ? (options.x_axis ? 1 : 0) : 1);
    if (options.x_axis_hidden != null && options.x_axis_hidden) this.x_axis = -1;
    this.y_axis = (typeof options.y_axis === "boolean" ? options.y_axis : true);
    this.xlate_nsyms = (typeof options.xlate_nsyms === "number" ? options.xlate_nsyms : this.xlate_nsyms);
    this.xlate_start = (typeof options.xlate_start === "number" ? options.xlate_start : this.xlate_start);
    this.xlate_end = (typeof options.xlate_end === "number" ? options.xlate_end : this.xlate_end);
  }
};

Logo.prototype.add_pspm = function(pspm, column) {
  "use strict";
  var col;
  if (typeof column === "undefined") {
    column = 0;
  } else if (column < 0) {
    throw new Error("Column index out of bounds.");
  }
  this.pspm_list[this.rows] = pspm;
  this.pspm_column[this.rows] = column;
  this.rows++;
  col = column + pspm.get_motif_length();
  if (col > this.columns) {
    this.columns = col;
  }
};

Logo.prototype.get_columns = function() {
  "use strict";
  return this.columns;
};

Logo.prototype.get_xlate_nsyms = function() {
  "use strict";
  return this.xlate_nsyms;
};

Logo.prototype.get_xlate_start = function() {
  "use strict";
  return (this.xlate_start != null ? this.xlate_start : 0);
};

Logo.prototype.get_xlate_end = function() {
  "use strict";
  return (this.xlate_end != null ? this.xlate_end : this.columns * this.xlate_nsyms);
};

Logo.prototype.get_xlate_columns = function() {
  "use strict";
  return this.get_xlate_end() - this.get_xlate_start();
};

Logo.prototype.get_rows = function() {
  "use strict";
  return this.rows;
};

Logo.prototype.get_pspm = function(row_index) {
  "use strict";
  if (row_index < 0 || row_index >= this.rows) {
    throw new Error("INDEX_OUT_OF_BOUNDS");
  }
  return this.pspm_list[row_index];
};

Logo.prototype.get_offset = function(row_index) {
  "use strict";
  if (row_index < 0 || row_index >= this.rows) {
    throw new Error("INDEX_OUT_OF_BOUNDS");
  }
  return this.pspm_column[row_index];
};

Logo.prototype._as_eps_data = function(ssc, errbars) {
  var i, j, pos, stack_pos, pspm, stack, sym, out;
  out = "";
  for (i = 0; i < this.rows; i++) {
    out += "\nStartLine\n";
    // Indent
    for (j = 0; j < this.pspm_column[i]; j++) {
      out += "() startstack\nendstack\n\n";
    }
    pspm = this.pspm_list[i];
    if (pspm.get_left_trim() > 0) {
      out += "MuteColour\nDrawTrimEdge\n" + pspm.get_left_trim() + " DrawTrimBg\n";
    }
    for (pos = 0; pos < pspm.get_motif_length(); pos++) {
      if (pos != 0 && pos == pspm.get_left_trim()) { // enable full colour
        out += "DrawTrimEdge\nRestoreColour\n";
      } else if (pos == (pspm.get_motif_length() - pspm.get_right_trim())) {
        out += "MuteColour\n" + pspm.get_right_trim() + " DrawTrimBg\n";
      }
      out += "(" + (pos + 1) + ") startstack\n";
      stack = pspm.get_stack(pos, this.alphabet, ssc);
      for (stack_pos = 0; stack_pos < stack.length; stack_pos++) {
        sym = stack[stack_pos];
        out += " " + (sym.get_scale() * this.alphabet.get_ic()) + " (" + sym.get_symbol() + ") numchar\n";
      }
      if (errbars) {
        out += " " + pspm.get_error(this.alphabet) + " Ibeam\n";
      }
      out += "endstack\n\n";
    }
    if (pspm.get_right_trim() > 0 || pspm.get_left_trim() == pspm.get_motif_length()) {
      out += "RestoreColour\n";
    }
    out += "EndLine\n";
  }
  return out;
};

Logo.prototype.as_eps = function(options) {
  "use strict";
  if (this.xlate_nsyms != 1) throw new Error("Unsupported setting xlate_nsyms for EPS");
  if (this.xlate_start != null) throw new Error("Unsupported setting xlate_start for EPS");
  if (this.xlate_end != null) throw new Error("Unsupported setting xlate_end for EPS");

  var LOGOHEIGHT = 7.5; // default height of line in cm
  var cm2pts, height, width, now, ssc, errbars;
  if (typeof options === "undefined") {
    options = {};
  }
  cm2pts = 72 / 2.54;
  if (typeof options.logo_height == "number") {
    height = options.logo_height;
  } else {
    height = LOGOHEIGHT * this.rows;
  }
  if (typeof options.logo_width == "number") {
    width = options.logo_width;
  } else {
    width = this.columns + 2;
  }
  now = new Date();
  ssc = (typeof options.ssc == "boolean" ? options.ssc : false);
  errbars = (typeof options.show_error_bar == "boolean" ? options.show_error_bar : ssc);
  var values = {
    "LOGOHEIGHT": height,
    "LOGOWIDTH": width,
    "BOUNDINGHEIGHT": Math.round(height * cm2pts),
    "BOUNDINGWIDTH": Math.round(width * cm2pts),
    "LOGOLINEHEIGHT": (height / this.rows),
    "CHARSPERLINE": this.columns,
    "BARBITS": this.alphabet.get_ic(),
    "LOGOTYPE": (this.alphabet.has_complement() ? "NA" : "AA"),
    "CREATIONDATE": now.getDate() + "." + (now.getMonth() + 1) + "." + now.getFullYear() + " " + now.getHours() + ":" + now.getMinutes() + ":" + now.getSeconds(),
    "ERRORBARFRACTION": (typeof options.error_bar_fraction == "number" ? options.error_bar_fraction : 1.0),
    "TICBITS": (typeof options.ticbits == "number" ? options.ticbits : 1.0),
    "TITLE": (typeof options.title == "string" ? options.title : ""),
    "FINEPRINT": (typeof options.fineprint == "string" ? options.fineprint : this.fine_text),
    "XAXISLABEL": (typeof options.xaxislabel == "string" ? options.xaxislabel : ""),
    "YAXISLABEL": (typeof options.yaxislabel == "string" ? options.yaxislabel : "bits"),
    "SSC": ssc,
    "YAXIS": (typeof options.show_y_axis == "boolean" ? options.show_y_axis : this.y_axis),
    "SHOWENDS": (typeof options.show_ends == "boolean" ? options.show_ends : false),
    "ERRBAR": errbars,
    "OUTLINE": (typeof options.show_outline == "boolean" ? options.show_outline : false),
    "NUMBERING": (typeof options.show_numbering == "boolean" ? options.show_numbering : this.x_axis != 0),
    "SHOWINGBOX": (typeof options.show_box == "boolean" ? options.show_box : false),
    "CREATOR": (typeof options.creator == "string" ? options.creator : "motif_logo.js"),
    "FONTSIZE": (typeof options.label_font_size == "number" ? options.label_font_size : 12),
    "TITLEFONTSIZE": (typeof options.title_font_size == "number" ? options.title_font_size : 12),
    "SMALLFONTSIZE": (typeof options.small_font_size == "number" ? options.small_font_size : 6),
    "TOPMARGIN" : (typeof options.top_margin == "number" ? options.top_margin : 0.9),
    "BOTTOMMARGIN": (typeof options.bottom_margin == "number" ? options.bottom_margin : 0.9),
    "COLORDICT": this.alphabet._as_eps_dict(),
    "DATA": this._as_eps_data(ssc, errbars)
  };
  // now this requires that the script containing the template has been imported!
  return motif_logo_template(values);
};

//======================================================================
// end Logo object
//======================================================================

// calculate the exact size (in pixels) of an object drawn on the
// canvas assuming that the background of the canvas is transparent.
function canvas_bounds(ctx, cwidth, cheight) {
  "use strict";
  var data, r, c, top_line, bottom_line, left_line, right_line, 
      txt_width, txt_height;

  // extract the image data
  data = ctx.getImageData(0, 0, cwidth, cheight).data;

  // set initial values
  top_line = -1; bottom_line = -1; left_line = -1; right_line = -1;
  txt_width = 0; txt_height = 0;

  // Find the top-most line with a non-transparent pixel
  for (r = 0; r < cheight; r++) {
    for (c = 0; c < cwidth; c++) {
      if (data[r * cwidth * 4 + c * 4 + 3]) {
        top_line = r;
        break;
      }
    }
    if (top_line != -1) {
      break;
    }
  }
  
  // Only bother looking if we found at least one set pixel... 
  if (top_line != -1) {

    //find the last line with a non-transparent pixel
    for (r = cheight-1; r >= top_line; r--) {
      for(c = 0; c < cwidth; c++) {
        if(data[r * cwidth * 4 + c * 4 + 3]) {
          bottom_line = r;
          break;
        }
      }
      if (bottom_line != -1) {
        break;
      }
    }
    // calculate height
    txt_height = bottom_line - top_line + 1;

    // Find the left-most line with a non-transparent pixel
    for (c = 0; c < cwidth; c++) {
      for (r = top_line; r <= bottom_line; r++) {
        if (data[r * cwidth * 4 + c * 4 + 3]) {
          left_line = c;
          break;
        }
      }
      if (left_line != -1) {
        break;
      }
    }

    //find the right most line with a non-transparent pixel
    for (c = cwidth-1; c >= left_line; c--) {
      for(r = top_line; r <= bottom_line; r++) {
        if(data[r * cwidth * 4 + c * 4 + 3]) {
          right_line = c;
          break;
        }
      }
      if (right_line != -1) {
        break;
      }
    }
    txt_width = right_line - left_line + 1;
  }

  //return the bounds
  return {bound_top: top_line, bound_bottom: bottom_line, 
    bound_left: left_line, bound_right: right_line, width: txt_width, 
    height: txt_height};
}

//======================================================================
// start RasterizedAlphabet
//======================================================================

// Rasterize Alphabet
// 1) Measure width of text at default font for all symbols in alphabet
// 2) sort in width ascending
// 3) Drop the top and bottom 10% (designed to ignore outliers like 'W' and 'I')
// 4) Calculate the average as the maximum scaling factor (designed to stop I becoming a rectangular blob).
// 5) Assume scale of zero would result in width of zero, interpolate scale required to make perfect width font
// 6) Draw text onto temp canvas at calculated scale
// 7) Find bounds of drawn text
// 8) Paint on to another canvas at the desired height (but only scaling width to fit if larger).
var RasterizedAlphabet = function(alphabet, logo_scale, font, width) {
  "use strict";
  var default_size, safety_pad, canvas, ctx, middle, baseline, widths, sizes,
      i, sym, size, tenpercent, avg_width, scale, 
      target_width, target_height;
  //variable prototypes
  this.alphabet = alphabet;
  this.scale = logo_scale;
  this.sym_cache = {};
  this.stack_num_cache = [];
  this.scale_num_cache = [];
  // size of canvas
  default_size = 60; // size of measuring canvas
  safety_pad = 20; // pixels to pad around so we don't miss the edges
  // create a canvas to do our measuring
  canvas = document.createElement("canvas");
  if (!canvas.getContext) throw new Error("No canvas support");
  canvas.width = default_size + 2 * safety_pad;
  canvas.height = default_size + 2 * safety_pad;
  middle = Math.round(canvas.width / 2);
  baseline = Math.round(canvas.height - safety_pad);
  ctx = canvas.getContext('2d');
  if (!supports_text(ctx)) throw new Error("Canvas does not support text");
  ctx.font = font;
  ctx.textAlign = "center";
  ctx.translate(middle, baseline);
  // list of widths
  widths = [];
  sizes = [];
  //now measure each letter in the alphabet
  for (i = 0; i < alphabet.get_size_core(); ++i) {
    // reset the canvas
    ctx.clearRect(0, 0, canvas.width, canvas.height);
    ctx.fillStyle = alphabet.get_colour(i);
    // draw the test text
    ctx.fillText(alphabet.get_symbol(i), 0, 0);
    //measure
    size = canvas_bounds(ctx, canvas.width, canvas.height);
    if (size.width === 0) throw new Error("Invisible symbol!");
    widths.push(size.width);
    sizes[i] = size;
  }
  //sort the widths
  widths.sort(function(a,b) {return a - b;});
  //drop 10% of the items off each end
  tenpercent = Math.floor(widths.length / 10);
  for (i = 0; i < tenpercent; ++i) {
    widths.pop();
    widths.shift();
  }
  //calculate average width
  avg_width = 0;
  for (i = 0; i < widths.length; ++i) {
    avg_width += widths[i];
  }
  avg_width /= widths.length;
  // calculate the target width
  target_width = width * this.scale * 2;
  // calculate scales
  for (i = 0; i < alphabet.get_size_core(); ++i) {
    sym = alphabet.get_symbol(i);
    size = sizes[i];
    // calculate scale
    scale = target_width / Math.max(avg_width, size.width);
    // estimate scaled height
    target_height = size.height * scale;
    // create an appropriately sized canvas
    canvas = document.createElement("canvas");
    canvas.width = target_width;
    canvas.height = target_height + safety_pad * 2;
    // calculate the middle
    middle = Math.round(canvas.width / 2);
    // calculate the baseline
    baseline = Math.round(canvas.height - safety_pad);
    // get the context and prepare to draw the rasterized text
    ctx = canvas.getContext('2d');
    ctx.font = font;
    ctx.fillStyle = alphabet.get_colour(i);
    ctx.textAlign = "center";
    ctx.translate(middle, baseline);
    ctx.save();
    ctx.scale(scale, scale);
    // draw the text
    ctx.fillText(sym, 0, 0);
    ctx.restore();
    this.sym_cache[sym] = {"image": canvas, "size": canvas_bounds(ctx, canvas.width, canvas.height)};
  }
};

RasterizedAlphabet.prototype.get_alphabet = function() {
  return this.alphabet;
};

RasterizedAlphabet.prototype.get_scale = function() {
  return this.scale;
};

RasterizedAlphabet.prototype.draw_stack_sym = function(ctx, letter, dx, dy, dWidth, dHeight) {
  "use strict";
  var entry, image, size;
  entry = this.sym_cache[letter];
  image = entry.image;
  size = entry.size;
  ctx.drawImage(image, 0, size.bound_top -1, image.width, size.height+1, dx, dy, dWidth, dHeight);
};

RasterizedAlphabet.prototype.draw_stack_num = function(ctx, font, stack_width, index) {
  var image, image_ctx, text_length;
  if (index >= this.stack_num_cache.length) {
    image = document.createElement("canvas");
    // measure the text
    image_ctx = image.getContext('2d');
    image_ctx.save();
    image_ctx.font = font;
    text_length = image_ctx.measureText("" + (index + 1)).width;
    image_ctx.restore();
    // resize the canvas to fit
    image.width = Math.ceil(stack_width);
    image.height = Math.ceil(text_length);
    // draw the text
    image_ctx = image.getContext('2d');
    image_ctx.translate(Math.round(stack_width / 2), 0);
    image_ctx.font = font;
    image_ctx.textBaseline = "middle";
    image_ctx.textAlign = "right";
    image_ctx.rotate(-(Math.PI / 2));
    image_ctx.fillText("" + (index + 1), 0, 0);
    this.stack_num_cache[index] = image;
  } else {
    image = this.stack_num_cache[index];
  }
  ctx.drawImage(image, 0, 0);
}

RasterizedAlphabet.prototype.draw_scale_num = function(ctx, font, num) {
  var image, image_ctx, text_size, m_length;
  if (num >= this.scale_num_cache.length) {
    image = document.createElement("canvas");
    // measure the text
    image_ctx = image.getContext('2d');
    image_ctx.font = font;
    text_size = image_ctx.measureText("" + num);
    if (text_size.actualBoundingBoxAscent && text_size.actualBoundingBoxDesent) {
      // resize the canvas to fit
      image.width = Math.ceil(text_size.width);
      image.height = Math.ceil(text_size.actualBoundingBoxAscent + text_size.actualBoundingBoxDesent);
      // draw the text
      image_ctx = image.getContext('2d');
      image_ctx.font = font;
      image_ctx.textAlign = "right";
      image_ctx.fillText("" + num, image.width, text_size.actualBoundingBoxAscent);
    } else {
      // measure width of 'm' to approximate height, we double it later anyway
      m_length = image_ctx.measureText("m").width;
      // resize the canvas to fit
      image.width = Math.ceil(text_size.width);
      image.height = Math.ceil(2 * m_length);
      // draw the text
      image_ctx = image.getContext('2d');
      image_ctx.font = font;
      image_ctx.textAlign = "right";
      image_ctx.textBaseline = "middle";
      image_ctx.fillText("" + num, image.width, m_length);
    }
    this.scale_num_cache[num] = image;
  } else {
    image = this.scale_num_cache[num];
  }
  ctx.drawImage(image, -image.width, -Math.round(image.height / 2))
}

//======================================================================
// end RasterizedAlphabet
//======================================================================

//======================================================================
// start LogoMetrics object
//======================================================================

var LogoMetrics = function(ctx, logo_columns, logo_rows, has_names, has_finetext, x_axis, y_axis) {
  "use strict";
  var i, row_height;
  //variable prototypes
  this.pad_top = (has_names ? 5 : 0);
  this.pad_left = (y_axis ? 10 : 0);
  this.pad_right = (has_finetext ? 15 : 0);
  this.pad_bottom = 0;
  this.pad_middle = 20;
  this.name_height = 14;
  this.name_font = "bold " + this.name_height + "px Times, sans-serif";
  this.name_spacer = 0;
  this.y_axis = y_axis;
  this.y_label = "bits";
  this.y_label_height = 12;
  this.y_label_font = "bold " + this.y_label_height + "px Helvetica, sans-serif";
  this.y_label_spacer = 3;
  this.y_num_height = 12;
  this.y_num_width = 0;
  this.y_num_font = "bold " + this.y_num_height + "px Helvetica, sans-serif";
  this.y_tic_width = 5;
  this.stack_pad_left = 0;
  this.stack_font = "bold 25px Helvetica, sans-serif";
  this.stack_height = 90;
  this.stack_width = 26;
  this.stacks_pad_right = 5;
  this.x_axis = x_axis;
  this.x_num_above = 2;
  this.x_num_height = 12;
  this.x_num_width = 0;
  this.x_num_font = "bold " + this.x_num_height + "px Helvetica, sans-serif";
  this.fine_txt_height = 6;
  this.fine_txt_above = 2;
  this.fine_txt_font = "normal " + this.fine_txt_height + "px Helvetica, sans-serif";
  this.letter_metrics = new Array();
  this.summed_width = 0;
  this.summed_height = 0;
  //calculate the width of the y axis numbers
  ctx.font = this.y_num_font;
  for (i = 0; i <= 2; i++) {
    this.y_num_width = Math.max(this.y_num_width, ctx.measureText("" + i).width);
  }
  //calculate the width of the x axis numbers (but they are rotated so it becomes height)
  if (x_axis == 1) {
    ctx.font = this.x_num_font;
    for (i = 1; i <= logo_columns; i++) {
      this.x_num_width = Math.max(this.x_num_width, ctx.measureText("" + i).width);
    }
  } else if (x_axis == 0) {
    this.x_num_height = 4;
    this.x_num_width = 4;
  } else {
    this.x_num_height = 0;
    this.x_num_width = 0;
  }
  
  //calculate how much vertical space we want to draw this
  //first we add the padding at the top and bottom since that's always there
  this.summed_height += this.pad_top + this.pad_bottom;
  //all except the last row have the same amount of space allocated to them
  if (logo_rows > 1) {
    row_height = this.stack_height + this.pad_middle;
    if (has_names) {
      row_height += this.name_height;
      //the label is allowed to overlap into the spacer
      row_height += Math.max(this.y_num_height/2, this.name_spacer); 
      //the label is allowed to overlap the space used by the other label
      row_height += Math.max(this.y_num_height/2, this.x_num_height + this.x_num_above); 
    } else {
      row_height += this.y_num_height/2; 
      //the label is allowed to overlap the space used by the other label
      row_height += Math.max(this.y_num_height/2, this.x_num_height + this.x_num_above); 
    }
    this.summed_height += row_height * (logo_rows - 1);
  }
  //the last row has the name and fine text below it but no padding
  this.summed_height += this.stack_height + (this.y_axis ? this.y_num_height/2 : 0);

  var fine_txt_total = (has_finetext ? this.fine_txt_height + this.fine_txt_above : 0);
  if (has_names) {
    this.summed_height += fine_txt_total + this.name_height;
    this.summed_height += Math.max((this.y_axis ? this.y_num_height/2 : 0), 
        this.x_num_height + this.x_num_above + this.name_spacer);
  } else {
    this.summed_height += Math.max((this.y_axis ? this.y_num_height/2 : 0), 
        this.x_num_height + this.x_num_above + fine_txt_total);
  }

  //calculate how much horizontal space we want to draw this
  //first add the padding at the left and right since that's always there
  this.summed_width += this.pad_left + this.pad_right;
  if (this.y_axis) {
    //add on the space for the y-axis label
    this.summed_width += this.y_label_height + this.y_label_spacer;
    //add on the space for the y-axis
    this.summed_width += this.y_num_width + this.y_tic_width;
  }
  //add on the space for the stacks
  this.summed_width += (this.stack_pad_left + this.stack_width) * logo_columns;
  //add on the padding after the stacks (an offset from the fine text)
  this.summed_width += this.stacks_pad_right;

};

//======================================================================
// end LogoMetrics object
//======================================================================

//found this trick at http://talideon.com/weblog/2005/02/detecting-broken-images-js.cfm
function image_ok(img) {
  "use strict";
  // During the onload event, IE correctly identifies any images that
  // weren't downloaded as not complete. Others should too. Gecko-based
  // browsers act like NS4 in that they report this incorrectly.
  if (!img.complete) {
    return false;
  }
  // However, they do have two very useful properties: naturalWidth and
  // naturalHeight. These give the true size of the image. If it failed
  // to load, either of these should be zero.
  if (typeof img.naturalWidth !== "undefined" && img.naturalWidth === 0) {
    return false;
  }
  // No other way of checking: assume it's ok.
  return true;
}
  
function supports_text(ctx) {
  "use strict";
  if (!ctx.fillText) {
    return false;
  }
  if (!ctx.measureText) {
    return false;
  }
  return true;
}

//draws the scale, returns the width
function draw_scale(ctx, metrics, alphabet_ic, raster) {
  "use strict";
  var tic_height, i;
  tic_height = metrics.stack_height / alphabet_ic;
  ctx.save();
  ctx.translate(metrics.y_label_height, metrics.y_num_height/2);
  //draw the axis label
  ctx.save();
  ctx.font = metrics.y_label_font;
  ctx.translate(0, metrics.stack_height/2);
  ctx.rotate(-(Math.PI / 2));
  ctx.textAlign = "center";
  ctx.fillText("bits", 0, 0);
  ctx.restore();

  ctx.translate(metrics.y_label_spacer + metrics.y_num_width, 0);

  //draw the axis tics
  ctx.save();
  ctx.translate(0, metrics.stack_height);
  for (i = 0; i <= alphabet_ic; i++) {
    //draw the number
    ctx.save();
    ctx.translate(-1, 0);
    raster.draw_scale_num(ctx, metrics.y_num_font, i);
    ctx.restore();
    //draw the tic
    ctx.fillRect(0, -1, metrics.y_tic_width, 2);
    //prepare for next tic
    ctx.translate(0, -tic_height);
  }
  ctx.restore();

  ctx.fillRect(metrics.y_tic_width - 2, 0, 2, metrics.stack_height)

  ctx.restore();
}

function draw_stack_num(ctx, metrics, row_index, raster) {
  "use strict";
  ctx.save();
  ctx.translate(0, Math.round(metrics.stack_height + metrics.x_num_above));
  if (metrics.x_axis == 1) {
    raster.draw_stack_num(ctx, metrics.x_num_font, metrics.stack_width, row_index);
  } else if (metrics.x_axis == 0) {
    // draw dots instead of the numbers (good for small logos)
    ctx.beginPath();
    var radius = Math.round(metrics.x_num_height / 2);
    ctx.arc(Math.round(metrics.stack_width / 2), radius, radius, 0, 2 * Math.PI, false);
    ctx.fill();
  }
  ctx.restore();
}

function draw_stack(ctx, metrics, symbols, raster) {
  "use strict";
  var preferred_pad, sym_min, i, sym, sym_height, pad;
  preferred_pad = 0;
  sym_min = 5;

  ctx.save();//1
  ctx.translate(0, metrics.stack_height);
  for (i = 0; i < symbols.length; i++) {
    sym = symbols[i];
    sym_height = metrics.stack_height * sym.get_scale();
    
    pad = preferred_pad;
    if (sym_height - pad < sym_min) {
      pad = Math.min(pad, Math.max(0, sym_height - sym_min));
    }
    sym_height -= pad;

    //translate to the correct position
    ctx.translate(0, -(pad/2 + sym_height));

    //draw
    raster.draw_stack_sym(ctx, sym.get_symbol(), 0, 0, metrics.stack_width, sym_height);
    //translate past the padding
    ctx.translate(0, -(pad/2));
  }
  ctx.restore();//1
}

function draw_dashed_line(ctx, pattern, start, x1, y1, x2, y2) {
  "use strict";
  var x, y, len, i, dx, dy, tlen, theta, mulx, muly, lx, ly;
  dx = x2 - x1;
  dy = y2 - y1;
  tlen = Math.pow(dx*dx + dy*dy, 0.5);
  theta = Math.atan2(dy,dx);
  mulx = Math.cos(theta);
  muly = Math.sin(theta);
  lx = [];
  ly = [];
  for (i = 0; i < pattern; ++i) {
    lx.push(pattern[i] * mulx);
    ly.push(pattern[i] * muly);
  }
  i = start;
  x = x1;
  y = y1;
  len = 0;
  ctx.beginPath();
  while (len + pattern[i] < tlen) {
    ctx.moveTo(x, y);
    x += lx[i];
    y += ly[i];
    ctx.lineTo(x, y);
    len += pattern[i];
    i = (i + 1) % pattern.length;
    x += lx[i];
    y += ly[i];
    len += pattern[i];
    i = (i + 1) % pattern.length;
  }
  if (len < tlen) {
    ctx.moveTo(x, y);
    x += mulx * (tlen - len);
    y += muly * (tlen - len);
    ctx.lineTo(x, y);
  }
  ctx.stroke();
}

function draw_trim_background(ctx, metrics, left_start, left_end, left_divider, right_start, right_end, right_divider) {
  "use strict";
  var left_size = left_end - left_start;
  var right_size = right_end - right_start;
  var line_x;

  ctx.save();//s8
  ctx.fillStyle = "rgb(240, 240, 240)";
  if (left_size > 0) {
    ctx.fillRect(left_start * metrics.stack_width, 0, left_size * metrics.stack_width, metrics.stack_height);
  }
  if (right_size > 0) {
    ctx.fillRect(right_start * metrics.stack_width, 0, right_size * metrics.stack_width, metrics.stack_height);
  }
  ctx.fillStyle = "rgb(51, 51, 51)";
  if (left_size > 0 && left_divider) {
    line_x = (left_end * metrics.stack_width) - 0.5;
    draw_dashed_line(ctx, [3], 0, line_x, 0, line_x, metrics.stack_height);
  }
  if (right_size > 0 && right_divider) {
    line_x = (right_start * metrics.stack_width) + 0.5;
    draw_dashed_line(ctx, [3], 0, line_x, 0, line_x, metrics.stack_height);
  }
  ctx.restore();//s8
}

function size_logo_on_canvas(logo, canvas, show_names, scale) {
  "use strict";
  var draw_name, draw_finetext, metrics;
  draw_name = (typeof show_names === "boolean" ? show_names : (logo.get_rows() > 1));
  draw_finetext = (logo.fine_text.length > 0);
  if (canvas.width !== 0 && canvas.height !== 0) {
    return;
  }
  metrics = new LogoMetrics(canvas.getContext('2d'), 
      logo.get_xlate_columns(), logo.get_rows(), draw_name, draw_finetext, logo.x_axis, logo.y_axis);
  if (typeof scale == "number") {
    //resize the canvas to fit the scaled logo
    canvas.width = metrics.summed_width * scale;
    canvas.height = metrics.summed_height * scale;
  } else {
    if (canvas.width === 0 && canvas.height === 0) {
      canvas.width = metrics.summed_width;
      canvas.height = metrics.summed_height;
    } else if (canvas.width === 0) {
      canvas.width = metrics.summed_width * (canvas.height / metrics.summed_height);
    } else if (canvas.height === 0) {
      canvas.height = metrics.summed_height * (canvas.width / metrics.summed_width);
    }
  }
}

function draw_logo_on_canvas(logo, canvas, show_names, scale) {
  "use strict";
  var i, draw_name, draw_finetext, ctx, metrics, raster, pspm_i, pspm, 
      offset, col_index, motif_position, ssc;
  ssc = false;
  draw_name = (typeof show_names === "boolean" ? show_names : (logo.get_rows() > 1));
  draw_finetext = (logo.fine_text.length > 0);
  ctx = canvas.getContext('2d');
  //assume that the user wants the canvas scaled equally so calculate what the best width for this image should be
  metrics = new LogoMetrics(ctx, logo.get_xlate_columns(), logo.get_rows(), draw_name, draw_finetext, logo.x_axis, logo.y_axis);
  if (typeof scale == "number") {
    //resize the canvas to fit the scaled logo
    canvas.width = metrics.summed_width * scale;
    canvas.height = metrics.summed_height * scale;
  } else {
    if (canvas.width === 0 && canvas.height === 0) {
      scale = 1;
      canvas.width = metrics.summed_width;
      canvas.height = metrics.summed_height;
    } else if (canvas.width === 0) {
      scale = canvas.height / metrics.summed_height;
      canvas.width = metrics.summed_width * scale;
    } else if (canvas.height === 0) {
      scale = canvas.width / metrics.summed_width;
      canvas.height = metrics.summed_height * scale;
    } else {
      scale = Math.min(canvas.width / metrics.summed_width, canvas.height / metrics.summed_height);
    }
  }
  // cache the raster based on the assumption that we will be drawing a lot
  // of logos the same size and alphabet
  if (typeof draw_logo_on_canvas.raster_cache === "undefined") {
    draw_logo_on_canvas.raster_cache = [];
  }
  for (i = 0; i < draw_logo_on_canvas.raster_cache.length; i++) {
    raster = draw_logo_on_canvas.raster_cache[i];
    if (raster.get_alphabet().equals(logo.alphabet) &&
        Math.abs(raster.get_scale() - scale) < 0.1) break;
    raster = null;
  }
  if (raster == null) {
    raster = new RasterizedAlphabet(logo.alphabet, scale, metrics.stack_font, metrics.stack_width);
    draw_logo_on_canvas.raster_cache.push(raster);
  }
  ctx = canvas.getContext('2d');
  ctx.save();//s1
  ctx.scale(scale, scale);
  ctx.save();//s2
  ctx.save();//s7
  //create margin
  ctx.translate(Math.round(metrics.pad_left), Math.round(metrics.pad_top));
  for (pspm_i = 0; pspm_i < logo.get_rows(); ++pspm_i) {
    pspm = logo.get_pspm(pspm_i);
    offset = logo.get_offset(pspm_i);
    //optionally draw name if this isn't the last row or is the only row 
    if (draw_name && (logo.get_rows() == 1 || pspm_i != (logo.get_rows()-1))) {
      ctx.save();//s4
      ctx.translate(Math.round(metrics.summed_width/2), Math.round(metrics.name_height));
      ctx.font = metrics.name_font;
      ctx.textAlign = "center";
      ctx.fillText(pspm.name, 0, 0);
      ctx.restore();//s4
      ctx.translate(0, Math.round(metrics.name_height + 
          Math.min(0, metrics.name_spacer - metrics.y_num_height/2)));
    }
    //draw scale
    if (logo.y_axis) draw_scale(ctx, metrics, logo.alphabet.get_ic(), raster);
    ctx.save();//s5
    //translate across past the scale
    if (logo.y_axis) {
      ctx.translate(Math.round(metrics.y_label_height + metrics.y_label_spacer + 
        metrics.y_num_width + metrics.y_tic_width), Math.round(metrics.y_num_height / 2));
    }
    //draw the trimming background
    if (pspm.get_left_trim() > 0 || pspm.get_right_trim() > 0) {
      var left_start = offset * logo.get_xlate_nsyms();
      var left_end = (offset + pspm.get_left_trim()) * logo.get_xlate_nsyms();
      var left_divider = true;
      if (left_end < logo.get_xlate_start() || left_start > logo.get_xlate_end()) {
        // no overlap
        left_start = 0;
        left_end = 0;
        left_divider = false;
      } else {
        if (left_start < logo.get_xlate_start()) {
          left_start = logo.get_xlate_start();
        }
        if (left_end > logo.get_xlate_end()) {
          left_end = logo.get_xlate_end();
          left_divider = false;
        }
        left_start -= logo.get_xlate_start();
        left_end -= logo.get_xlate_start();
        if (left_end < left_start) {
          left_start = 0;
          left_end = 0;
          left_divider = false;
        }
      }
      var right_end = (offset + pspm.get_motif_length()) * logo.get_xlate_nsyms();
      //var right_start = right_end - (pspm.get_left_trim() * logo.get_xlate_nsyms());
      var right_start = right_end - (pspm.get_right_trim() * logo.get_xlate_nsyms());
      var right_divider = true;
      if (right_end < logo.get_xlate_start() || right_start > logo.get_xlate_end()) {
        // no overlap
        right_start = 0;
        right_end = 0;
        right_divider = false;
      } else {
        if (right_start < logo.get_xlate_start()) {
          right_start = logo.get_xlate_start();
          right_divider = false;
        }
        if (right_end > logo.get_xlate_end()) {
          right_end = logo.get_xlate_end();
        }
        right_start -= logo.get_xlate_start();
        right_end -= logo.get_xlate_start();
        if (right_end < right_start) {
          right_start = 0;
          right_end = 0;
          right_divider = false;
        }
      }
      draw_trim_background(ctx, metrics, left_start, left_end, left_divider, right_start, right_end, right_divider);
    }
    //draw letters
    var xlate_col;
    for (xlate_col = logo.get_xlate_start(); xlate_col < logo.get_xlate_end(); xlate_col++) {
      ctx.translate(metrics.stack_pad_left,0);
      col_index = Math.floor(xlate_col / logo.get_xlate_nsyms());
      if (xlate_col % logo.get_xlate_nsyms() == 0) {
        if (col_index >= offset && col_index < (offset + pspm.get_motif_length())) {
          motif_position = col_index - offset;
          draw_stack_num(ctx, metrics, motif_position, raster);
          draw_stack(ctx, metrics, pspm.get_stack(motif_position, logo.alphabet, ssc), raster);
        }
      } else {
        if (col_index >= offset && col_index < (offset + pspm.get_motif_length())) {
          ctx.save();// s5.1
          ctx.translate(0, Math.round(metrics.stack_height));
          // TODO draw a dot or dash or something to indicate continuity of the motif
          ctx.restore(); //s5.1
        }
      }
      ctx.translate(Math.round(metrics.stack_width), 0);
    }
    ctx.restore();//s5
    ////optionally draw name if this is the last row but isn't the only row 
    if (draw_name && (logo.get_rows() != 1 && pspm_i == (logo.get_rows()-1))) {
      //translate vertically past the stack and axis's        
      ctx.translate(0, metrics.y_num_height/2 + metrics.stack_height + 
          Math.max(metrics.y_num_height/2, metrics.x_num_above + metrics.x_num_width + metrics.name_spacer));

      ctx.save();//s6
      ctx.translate(metrics.summed_width/2, metrics.name_height);
      ctx.font = metrics.name_font;
      ctx.textAlign = "center";
      ctx.fillText(pspm.name, 0, 0);
      ctx.restore();//s6
      ctx.translate(0, metrics.name_height);
    } else {
      //translate vertically past the stack and axis's        
      ctx.translate(0, metrics.y_num_height/2 + metrics.stack_height + 
          Math.max(metrics.y_num_height/2, metrics.x_num_above + metrics.x_num_width));
    }
    //if not the last row then add middle padding
    if (pspm_i != (logo.get_rows() -1)) {
      ctx.translate(0, metrics.pad_middle);
    }
  }
  ctx.restore();//s7
  if (logo.fine_text.length > 0) {
    ctx.translate(metrics.summed_width - metrics.pad_right, metrics.summed_height - metrics.pad_bottom);
    ctx.font = metrics.fine_txt_font;
    ctx.textAlign = "right";
    ctx.fillText(logo.fine_text, 0,0);
  }
  ctx.restore();//s2
  ctx.restore();//s1
}

function create_canvas(c_width, c_height, c_id, c_title, c_display) {
  "use strict";
  var canvas = document.createElement("canvas");
  //check for canvas support before attempting anything
  if (!canvas.getContext) {
    return null;
  }
  var ctx = canvas.getContext('2d');
  //check for html5 text drawing support
  if (!supports_text(ctx)) {
    return null;
  }
  //size the canvas
  canvas.width = c_width;
  canvas.height = c_height;
  canvas.id = c_id;
  canvas.title = c_title;
  canvas.style.display = c_display;
  return canvas;
}

function logo_1(alphabet, fine_text, pspm) {
  "use strict";
  var logo = new Logo(alphabet, fine_text);
  logo.add_pspm(pspm);
  return logo;
}

function logo_2(alphabet, fine_text, target, query, query_offset) {
  "use strict";
  var logo = new Logo(alphabet, fine_text);
  if (query_offset < 0) {
    logo.add_pspm(target, -query_offset);
    logo.add_pspm(query);
  } else {
    logo.add_pspm(target);
    logo.add_pspm(query, query_offset);
  }      
  return logo;
}

/*
 * Specifies an alternate source for an image.
 * If the image with the image_id specified has
 * not loaded then a generated logo will be used 
 * to replace it.
 *
 * Note that the image must either have dimensions
 * or a scale must be set.
 */
function alternate_logo(logo, image_id, scale) {
  "use strict";
  var image = document.getElementById(image_id);
  if (!image) {
    alert("Can't find specified image id (" +  image_id + ")");
    return;
  }
  //if the image has loaded then there is no reason to use the canvas
  if (image_ok(image)) {
    return;
  }
  //the image has failed to load so replace it with a canvas if we can.
  var canvas = create_canvas(image.width, image.height, image_id, image.title, image.style.display);
  if (canvas === null) {
    return;
  }
  //draw the logo on the canvas
  draw_logo_on_canvas(logo, canvas, null, scale);
  //replace the image with the canvas
  image.parentNode.replaceChild(canvas, image);
}

/*
 * Specifies that the element with the specified id
 * should be replaced with a generated logo.
 */
function replace_logo(logo, replace_id, scale, title_txt, display_style) {
  "use strict";
  var element = document.getElementById(replace_id);
  if (!replace_id) {
    alert("Can't find specified id (" + replace_id + ")");
    return;
  }
  //found the element!
  var canvas = create_canvas(50, 120, replace_id, title_txt, display_style);
  if (canvas === null) {
    return;
  }
  //draw the logo on the canvas
  draw_logo_on_canvas(logo, canvas, null, scale);
  //replace the element with the canvas
  element.parentNode.replaceChild(canvas, element);
}

/*
 * Fast string trimming implementation found at
 * http://blog.stevenlevithan.com/archives/faster-trim-javascript
 *
 * Note that regex is good at removing leading space but
 * bad at removing trailing space as it has to first go through
 * the whole string.
 */
function trim (str) {
  "use strict";
  var ws, i;
  str = str.replace(/^\s\s*/, '');
  ws = /\s/; i = str.length;
  while (ws.test(str.charAt(--i)));
  return str.slice(0, i + 1);
}
</script>
    <script>
var tomtom_alphabet = new Alphabet(data.alphabet, data.background);

var DelayLogoTask = function(logo, canvas) {
  this.logo = logo;
  this.canvas = canvas;
};

DelayLogoTask.prototype.run = function () {
  draw_logo_on_canvas(this.logo, this.canvas);
};

function make_logo(alphabet, pspm, rc, offset, className) {
  if (rc) pspm = pspm.copy().reverse_complement(alphabet);
  var logo = new Logo(alphabet, "");
  logo.add_pspm(pspm, offset);
  var canvas = document.createElement('canvas');
  canvas.height = 50;
  canvas.width = 0;
  canvas.className = className;
  size_logo_on_canvas(logo, canvas);
  add_draw_task(canvas, new DelayLogoTask(logo, canvas));
  return canvas;
}

function make_name(motif, should_link) {
  var name, link;
  name = motif.id + (typeof motif.alt === "string" ? " (" + motif.alt + ")" : "");
  if (should_link && typeof motif.url === "string") {
    link = document.createElement("a");
    link.href = motif.url;
    link.appendChild(document.createTextNode(name));
    return link;
  } else {
    return document.createTextNode(name);
  }
}

function make_logo_form() {
  $("logo_form").action = site_url + "/utilities/generate_logo";
  $("download_submit").addEventListener("click", function() {
    toggle_class(document.getElementById("download"), "hidden", true);
  }, false);
  $("download_cancel").addEventListener("click", function() {
    toggle_class(document.getElementById("download"), "hidden", true);
  }, false);
}

function make_alignment(query, target, rc, offset) {
  var logo, query_pspm, target_pspm;
  logo = new Logo(tomtom_alphabet, "");
  query_pspm = new Pspm(query.pwm, query.id, 0, 0, query.nsites);
  target_pspm = new Pspm(target.pwm, target.id, 0, 0, target.nsites);
  if (rc) target_pspm.reverse_complement(tomtom_alphabet);
  logo.add_pspm(target_pspm, (offset < 0 ? -offset : 0));
  logo.add_pspm(query_pspm, (offset < 0 ? 0 : offset));
  var canvas = document.createElement('canvas');
  canvas.height = 300;
  canvas.width = 0;
  canvas.title = "Click to show download options";
  size_logo_on_canvas(logo, canvas);
  add_draw_task(canvas, new DelayLogoTask(logo, canvas));
  return canvas;
}

function make_preview() {
  var i, j, qidx, tidx, query, target, match, matches, pview_table, pview_tbody, pview_row;
  var row, row_mlist, mlink;
  // scan the matches make a lookup from query index to matches index
  var lookup = {};
  for (i = 0; i < data.all_matches.length; i++) {
    lookup[data.all_matches[i].idx] = i;
  }

  pview_table = $("preview");
  pview_row = pview_table.querySelector(".pview_row");
  pview_tbody = pview_row.parentNode;
  pview_tbody.removeChild(pview_row);
  for (qidx = 0; qidx < data.queries.length; qidx++) {
    query = data.queries[qidx];
    matches = (lookup[qidx] != null ? data.all_matches[lookup[qidx]].matches : []);
    row = pview_row.cloneNode(true);
    row.querySelector(".pview_db").appendChild(document.createTextNode(data.query_dbs[query.db].name));
    row.querySelector(".pview_name").appendChild(document.createTextNode(query.id));
    if (typeof query.alt === "string") row.querySelector(".pview_alt").appendChild(document.createTextNode(query.alt));
    row.querySelector(".pview_logo").appendChild(make_logo(tomtom_alphabet, new Pspm(query.pwm)));
    row.querySelector(".pview_matches").appendChild(document.createTextNode(matches.length));
    row_mlist = row.querySelector(".pview_list");
    for (j = 0; j < matches.length; j++) {
      if (j > 0) row_mlist.appendChild(document.createTextNode(",\u2003 "));// EM Space
      match = matches[j];
      tidx = match.idx;
      target = data.targets[tidx];
      mlink = document.createElement("a");
      mlink.className = (qidx % 2 == 0 ? "ml1" : "ml2");
      mlink.appendChild(document.createTextNode(target.id));
      if (typeof target.alt === "string") mlink.appendChild(document.createTextNode("\u00A0(" + target.alt + ")"));
      mlink.href = "#match_" + qidx + "_" + tidx;
      row_mlist.appendChild(mlink);
    }
    pview_tbody.appendChild(row);
  }
}

function make_target_dbs() {
  var i, tdb_table, tdb_row, tdb_tbody, db;
  var row, match_count;
  tdb_table = $("tdbs");
  tdb_row = tdb_table.querySelector(".db_row");
  tdb_tbody = tdb_row.parentNode;
  tdb_tbody.removeChild(tdb_row);
  match_count = [];
  for (i = 0; i < data.target_dbs.length; i++) match_count[i] = 0;
  for (i = 0; i < data.targets.length; i++) {
    match_count[data.targets[i].db]++;
  }
  for (i = 0; i < data.target_dbs.length; i++) {
    db = data.target_dbs[i];
    row = tdb_row.cloneNode(true);
    row.querySelector(".db_name").appendChild(document.createTextNode(db.name));
    row.querySelector(".db_used").appendChild(document.createTextNode(db.loaded - db.excluded));
    row.querySelector(".db_matched").appendChild(document.createTextNode(match_count[i]));
    tdb_tbody.appendChild(row);
  }
  $("link_after_target_db").href = (data.all_matches.length > 0 ? "#query_" + data.all_matches[0].idx : "#settings");
}

function custom_logo(elem, qidx, tidx, rc, offset) {
  "use strict";
  function helper(qidx, tidx, rc, offset) {
    "use strict";
    return function() {
      if ($("dl_flip").value == "1") {
        $("dl_rc1").value = (rc ? "0" : "1");
        $("dl_rc2").value = "1";
        $("dl_shift").value = -(data.targets[tidx].len - (data.queries[qidx].len + offset));
      } else {
        $("dl_rc1").value = (rc ? "1" : "0");
        $("dl_rc2").value = "0";
        $("dl_shift").value = -offset;
      }
    };
  }
  var download_prompt, qidx, tidx, rc, offset, query, target, qmotif, tmotif;
  var flip_handler;
  // get the download prompt
  download_prompt = document.getElementById("download");
  // hide previous showing of the download prompt
  toggle_class(download_prompt, "hidden", true);
  if (typeof custom_logo.flip_handler !== "undefined") {
    $("dl_flip").removeEventListener("change", custom_logo.flip_handler, false);
  }
  // reset defaults on prompt
  $("dl_flip").value = "0";
  $("dl_width").value = "";
  $("dl_height").value = "";
  // configure download prompt to the selected logo
  query = data.queries[qidx];
  target = data.targets[tidx];
  tmotif = new Pspm(target.pwm, "1", 0, 0, target.nsites, target.evalue);
  qmotif = new Pspm(query.pwm, "2", 0, 0, query.nsites, query.evalue);
  $("dl_motifs").value = tmotif.as_meme({"with_header": true, "alphabet": tomtom_alphabet}) + qmotif.as_meme();
  $("dl_label1").value = target.id;
  $("dl_label2").value = query.id;
  flip_handler = helper(qidx, tidx, rc, offset);
  $("dl_flip").addEventListener("change", flip_handler, false);
  custom_logo.flip_handler = flip_handler;
  flip_handler();
  // position and display the download prompt
  position_popup(elem, download_prompt, 1);
  toggle_class(download_prompt, "hidden", false);
  // focus the download button
  $("download_submit").focus();
}

function make_custom_logo_handler(elem, qidx, tidx, rc, offset) {
  return function(evt) {
    custom_logo(elem, qidx, tidx, rc, offset);
    evt.preventDefault();
  };
}

function make_matches() {
  var i, j, matches_box, match_box, match_entry, box, links, entries, entry;
  var qidx, query, tidx, target, matches, overlap, rc, logo_container;
  var prev_query_link, next_query_link;
  matches_box = $("matches");
  match_box = matches_box.querySelector(".match_box");
  matches_box.removeChild(match_box);
  for (i = 0; i < data.all_matches.length; i++) {
    matches = data.all_matches[i].matches;
    qidx = data.all_matches[i].idx;
    query = data.queries[qidx];
    box = match_box.cloneNode(true);
    box.id = "query_" + qidx;
    box.querySelector(".query_name").appendChild(make_name(query, false));
    links = box.querySelector(".links");
    prev_query_link = (i == 0 ? "#target_dbs" : "#query_" + data.all_matches[i-1].idx);
    next_query_link = ((i + 1) >= data.all_matches.length ? "#settings" : "#query_" + data.all_matches[i+1].idx);
    links.querySelector(".prev").href = prev_query_link;
    links.querySelector(".next").href = next_query_link;
    match_entry = box.querySelector(".match_entry");
    entries = match_entry.parentNode;
    entries.removeChild(match_entry);
    for (j = 0; j < matches.length; j++) {
      tidx = matches[j].idx;
      target = data.targets[tidx];
      entry = match_entry.cloneNode(true);
      entry.id = "match_" + qidx + "_" + tidx;
      entry.querySelector(".match_name").appendChild(make_name(target, true));
      entry.querySelector(".match_db").appendChild(document.createTextNode(data.target_dbs[target.db].name));
      entry.querySelector(".match_pvalue").appendChild(document.createTextNode(matches[j].pv));
      entry.querySelector(".match_evalue").appendChild(document.createTextNode(matches[j].ev));
      entry.querySelector(".match_qvalue").appendChild(document.createTextNode(matches[j].qv));
      if (matches[j].off < 0) {
        overlap = Math.min(query.pwm.length + matches[j].off, target.pwm.length);
      } else if (matches[j].off == 0) {
        overlap = Math.min(query.pwm.length, target.pwm.length);
      } else {
        overlap = Math.min(query.pwm.length, target.pwm.length - matches[j].off);
      }
      entry.querySelector(".match_overlap").appendChild(document.createTextNode(overlap));
      entry.querySelector(".match_offset").appendChild(document.createTextNode(matches[j].off));
      rc = (typeof matches[j].rc === "boolean" && matches[j].rc);
      entry.querySelector(".match_orientation").appendChild(document.createTextNode(rc ? "Reverse Complement" : "Normal"));
      logo_container = entry.querySelector(".logo_container");
      logo_container.appendChild(make_alignment(query, target, rc, matches[j].off));
      entries.appendChild(entry);
      var custom_logo_handler = make_custom_logo_handler(logo_container.querySelector("canvas"), qidx, tidx, rc, matches[j].off);
      entry.querySelector(".download_btn").addEventListener("click", custom_logo_handler, false);
      entry.querySelector(".download_text").addEventListener("click", custom_logo_handler, false);
      entry.querySelector("canvas").addEventListener("click", custom_logo_handler, false);
      if (i != 0) entry.querySelector(".prev_query").href = prev_query_link;
      if ((i + 1) < data.all_matches.length) entry.querySelector(".next_query").href = next_query_link;
      if (j != 0) {
        entry.querySelector(".prev_target").href = "#match_" + qidx + "_" + matches[j-1].idx;
      } else if (i != 0) {
        var prev_query =  data.all_matches[i-1];
        var prev_qidx = prev_query.idx;
        var prev_matches = prev_query.matches;
        var prev_tidx = prev_matches[prev_matches.length - 1].idx;
        entry.querySelector(".prev_target").href = "#match_" + prev_qidx + "_" + prev_tidx;
      }
      if ((j + 1) < matches.length) {
        entry.querySelector(".next_target").href = "#match_" + qidx + "_" + matches[j+1].idx;
      } else if ((i + 1) < data.all_matches.length) {
        var next_query = data.all_matches[i+1];
        var next_qidx = next_query.idx;
        var next_matches = next_query.matches;
        var next_tidx = next_matches[0].idx;
        entry.querySelector(".next_target").href = "#match_" + next_qidx + "_" + next_tidx;
      }
    }

    matches_box.appendChild(box);
  }

}

function make_program() {
  $("link_before_program").href = (data.all_matches.length > 0 ? "#query_" + data.all_matches[data.all_matches.length - 1].idx : "#target_dbs");
  $("version").appendChild(document.createTextNode(data.version));
  $("release").appendChild(document.createTextNode(data.release));
  $("cmd").value = data.cmd.join(" ");
  $("runtime").appendChild(document.createTextNode(data.runtime.seconds));
}
</script>
    <style>
/* The following is the content of meme.css */
body { background-color:white; font-size: 12px; font-family: Verdana, Arial, Helvetica, sans-serif;}

div.help {
  display: inline-block;
  margin: 0px;
  padding: 0px;
  width: 12px;
  height: 13px;
  cursor: pointer;
  background-image: url(data:image/gif;base64,R0lGODlhDAANAIABANR0AP///yH5BAEAAAEALAAAAAAMAA0AAAIdhI8Xy22MIFgv1DttrrJ7mlGNNo4c+aFg6SQuUAAAOw==);
}

div.help:hover {
  background-image: url(data:image/gif;base64,R0lGODlhDAANAKEAANR0AP///9R0ANR0ACH+EUNyZWF0ZWQgd2l0aCBHSU1QACH5BAEAAAIALAAAAAAMAA0AAAIdDGynCe3PgoxONntvwqz2/z2K2ImjR0KhmSIZUgAAOw==);
}

p.spaced { line-height: 1.8em;}

span.citation { font-family: "Book Antiqua", "Palatino Linotype", serif; color: #004a4d;}

p.pad { padding-left: 30px; padding-top: 5px; padding-bottom: 10px;}

td.jump { font-size: 13px; color: #ffffff; background-color: #00666a;
  font-family: Georgia, "Times New Roman", Times, serif;}

a.jump { margin: 15px 0 0; font-style: normal; font-variant: small-caps;
  font-weight: bolder; font-family: Georgia, "Times New Roman", Times, serif;}

h2.mainh {font-size: 1.5em; font-style: normal; margin: 15px 0 0;
  font-variant: small-caps; font-family: Georgia, "Times New Roman", Times, serif;}

h2.line {border-bottom: 1px solid #CCCCCC; font-size: 1.5em; font-style: normal;
  margin: 15px 0 0; padding-bottom: 3px; font-variant: small-caps;
  font-family: Georgia, "Times New Roman", Times, serif;}

h4 {border-bottom: 1px solid #CCCCCC; font-size: 1.2em; font-style: normal;
  margin: 10px 0 0; padding-bottom: 3px; font-family: Georgia, "Times New Roman", Times, serif;}

h5 {margin: 0px}

a.help { font-size: 9px; font-style: normal; text-transform: uppercase;
  font-family: Georgia, "Times New Roman", Times, serif;}

div.pad { padding-left: 30px; padding-top: 5px; padding-bottom: 10px;}

div.pad1 { margin: 10px 5px;}

div.pad2 { margin: 25px 5px 5px;}
h2.pad2 { padding: 25px 5px 5px;}

div.pad3 { padding: 5px 0px 10px 30px;}

div.box { border: 2px solid #CCCCCC; padding:10px; overflow: hidden;}

div.bar { border-left: 7px solid #00666a; padding:5px; margin-top:25px; }

div.subsection {margin:25px 0px;}

img {border:0px none;}

th.majorth {text-align:left;}
th.minorth {font-weight:normal; text-align:left; width:8em; padding: 3px 0px;}
th.actionth {font-weight:normal; text-align:left;}

.explain h5 {font-size:1em; margin-left: 1em;}

div.doc {margin-left: 2em; margin-bottom: 3em;}

th.trainingset {
  border-bottom: thin dashed black; 
  font-weight:normal; 
  padding:0px 10px;
}
div.pop_content {
  position:absolute;
  z-index:50;
  width:300px;
  padding: 5px;
  background: #E4ECEC;
  font-size: 12px;
  font-family: Arial;
  border-style: double;
  border-width: 3px;
  border-color: #AA2244;
  display:none;
}

div.pop_content > *:first-child {
  margin-top: 0px;
}

div.pop_content h1, div.pop_content h2, div.pop_content h3, div.pop_content h4, 
div.pop_content h5, div.pop_content h6, div.pop_content p {
  margin: 0px;
}

div.pop_content p + h1, div.pop_content p + h2, div.pop_content p + h3, 
div.pop_content p + h4, div.pop_content p + h5, div.pop_content p + h6 {
  margin-top: 5px;
}

div.pop_content p + p {
  margin-top: 5px;
}

div.pop_content > *:last-child {
  margin-bottom: 0px;
}

div.pop_content div.pop_close {
  /* old definition */
  float:right;
  bottom: 0;
}

div.pop_content span.pop_close, div.pop_content span.pop_back {
  display: inline-block;
  border: 2px outset #661429;
  background-color: #CCC;
  padding-left: 1px;
  padding-right: 1px;
  padding-top: 0px;
  padding-bottom: 0px;
  cursor: pointer;
  color: #AA2244; /*#661429;*/
  font-weight: bold;
}

div.pop_content span.pop_close:active, div.pop_content span.pop_back:active {
  border-style: inset;
}

div.pop_content span.pop_close {
  float:right;
  /*border: 2px outset #AA002B;*/
  /*color: #AA2244;*/
}

div.pop_content:not(.nested) .nested_only {
  display: none;
}

div.pop_back_sec {
  margin-bottom: 5px;
}

div.pop_close_sec {
  margin-top: 5px;
}

table.hide_advanced tr.advanced {
  display: none;
}
span.show_more {
  display: none;
}
table.hide_advanced span.show_more {
  display: inline;
}
table.hide_advanced span.show_less {
  display: none;
}


/*****************************************************************************
 * Program logo styling
 ****************************************************************************/
div.prog_logo {
  border-bottom: 0.25em solid #0f5f60;
  height: 4.5em;
  width: 24em;
  display:inline-block;
}
div.prog_logo img {
  float:left;
  width: 4em;
  border-style: none;
  margin-right: 0.2em;
}
div.prog_logo h1, div.prog_logo h1:hover, div.prog_logo h1:active, div.prog_logo h1:visited {
  margin:0;
  padding:0;
  font-family: Arial, Helvetica,  sans-serif;
  font-size: 3.2em;
  line-height: 1em;
  vertical-align: top;
  display: block;
  color: #026666;
  letter-spacing: -0.06em;
  text-shadow: 0.04em 0.06em 0.05em #666;
}
div.prog_logo h2, div.prog_logo h2:hover, div.prog_logo h2:active, div.prog_logo h2:visited {
  display: block;
  margin:0;
  padding:0;
  font-family: Helvetica, sans-serif;
  font-size: 0.9em;
  line-height: 1em;
  letter-spacing: -0.06em;
  color: black;
}

div.big.prog_logo {
  font-size: 18px;
}

</style>
    <style>
div.header {
  position: relative;
  overflow: hidden;
  margin-top: 15px;
  margin-bottom: 5px;
  margin-right: 3px;
  margin-left: 3px;
}
div.header > h2 {
  font-size: 1.5em;
  font-style: normal;
  margin: 0;
  font-variant: small-caps; 
  font-family: Georgia, "Times New Roman", Times, serif;
}
div.header > span {
  position: absolute;
  right: 0;
  bottom: 0;
}

table.th_ul th {
  white-space: nowrap;
  font-size: 1.2em;
  font-style: normal;
  font-family: Georgia, "Times New Roman", Times, serif;
}

table.th_ul th > span {
  display: block;
  border-bottom: 1px solid #CCCCCC;
  margin-right: 3px;
  padding-bottom: 1px; 
}

table.targets td {
  padding: 0 10px;
}
table.preview td {
  padding: 0 10px;
}
table.preview tbody td {
  padding-bottom: 10px;
}
.ac {
  text-align: center;
}
.downloadTd {
  padding-left:20px;
}
div.logo_container {
}
table.match_summary tbody tr:first-child td, table.match_summary tbody tr:first-child th {
  padding-top: 20px;
}

/* motif list link, first style */
a.ml1 {
}
a.ml2 {
}
div.ml {
  line-height: 1.8em;
  height: 3.6em;
  overflow-y: auto;
}
td.ml div {

}

table.match_summary {
  width: 100%;
}

table.match_summary th {
  min-width: 10em;
}

table.match_summary div.help, table.dl_opts div.help {
  opacity: 0.0;
    -moz-transition: opacity 0.5s;
    -webkit-transition: opacity 0.5s;
    -o-transition: opacity 0.5s;
    transition: opacity 0.5s;
}

table.match_summary tr:hover div.help, table.dl_opts tr:hover div.help {
  opacity: 1.0;
}

#download {
  position:absolute;
  display: inline-block;
  z-index:9;
  padding: 5px;
  background-color: #FFF;
  border-style: double;
  border-width: 5px;
  border-color: #00666a;
}

#download.hidden {
  visibility: hidden;
}

div.custom_logo {
  text-align: center;
  margin-top: 20px;
}

div.logo_container {
  position: relative;
}

div.logo_container canvas {
  cursor: pointer;
}

a.download_text {
  display: block;
  margin-top: 5px;
  margin-bottom: 20px;
  color: #00c;
  text-align: center;
}
a.download_text:hover { 
  color: #00c;
}
a.download_text:active {
  color: #c00;
}

a.prev_query, a.prev_target, a.next_target, a.next_query, a.download_btn {
  font-family: arial;
  font-size: xx-large;
  text-decoration: none;
  color: #000;
}
a.prev_query:hover, a.prev_target:hover, a.next_target:hover, a.next_query:hover, a.download_btn:hover {
  background: #000;
  color: #FFF;
}

a.prev_query {
  position: absolute;
  display: inline-block;
  right:0;
  top:0;
}
a.prev_target {
  position: absolute;
  display: inline-block;
  right:0;
  top: 30%;
  transform: translateY(-50%);
}
a.download_btn {
  position: absolute;
  display: inline-block;
  right:0;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
}
a.next_target {
  position: absolute;
  display: inline-block;
  right:0;
  top: 70%;
  transform: translateY(-50%);
}
a.next_query {
  position: absolute;
  display: inline-block;
  right:0;
  bottom:0;
}

a.prev_target:not([href]), a.next_target:not([href]), a.prev_query:not([href]), a.next_query:not([href]) {
  color: #BBB;
  cursor: pointer;
}
a.prev_target:hover:not([href]), a.next_target:hover:not([href]), a.prev_query:hover:not([href]), a.next_query:hover:not([href]) {
  color: #FFF;
  background: #BBB;
}

table.inputs, table.alpha_bg_table {
  margin-top: 20px;
  border-collapse:collapse;
}
table.inputs * td, table.inputs * th, table.alpha_bg_table * td, table.alpha_bg_table * th {
  padding-left: 15px;
  padding-right: 15px;
  padding-top: 1px;
  padding-bottom: 1px;
}

span.strand_none, span.strand_given, span.strand_both, span.dist_allr,
    span.dist_ed, span.dist_kullback, span.dist_pearson, span.dist_sandelin,
    span.dist_blic1, span.dist_blic5, span.dist_llr1, span.dist_llr5,
    span.ttype_evalue, span.ttype_qvalue {
  display: none;
}

td.none span.strand_none, td.given span.strand_given, td.both span.strand_both,
    td.allr span.dist_allr, td.ed span.dist_ed, td.kullback span.dist_kullback, 
    td.pearson span.dist_pearson, td.sandelin span.dist_sandelin,
    td.blic1 span.dist_blic1, td.blic5 span.dist_blic5, td.llr1 span.dist_llr1,
    td.llr5 span.dist_llr5, td.evalue span.ttype_evalue, td.qvalue span.ttype_qvalue {
  display: inline;
}
</style>
  </head>
  <body data-scrollpad="true">
    <div id="grey_out_page" class="grey_background" style="display:none;"></div>
    <!-- {{{ help topics -->
    <div class="pop_content" id="pop_results_tsv">
      <script>print_doc("pop_results_tsv", "tomtom-results-tsv");</script>
      <div class="pop_close">[<a href="javascript:help_popup()">close</a> ]</div>
    </div>

    <div class="pop_content" id="pop_query_db">
      <script>print_doc_para("pop_query_db", "motif-db", "the query motif(s). Tomtom removes the '.meme' file name extension, if present.");</script>
      <div class="pop_close">[<a href="javascript:help_popup()">close</a> ]</div>
    </div>

    <div class="pop_content" id="pop_query_name">
      <script>print_doc_para("pop_query_name", "motif-id", "query");</script>
      <div class="pop_close">[<a href="javascript:help_popup()">close</a> ]</div>
    </div>
    
    <div class="pop_content" id="pop_query_alt">
      <script>print_doc_para("pop_query_alt", "motif-alt-id", "query");</script>
      <div class="pop_close">[<a href="javascript:help_popup()">close</a> ]</div>
    </div>
    
    <div class="pop_content" id="pop_query_web">
      <p>A link to more information about the query motif.</p>
      <div class="pop_close">[<a href="javascript:help_popup()">close</a> ]</div>
    </div>

    <div class="pop_content" id="pop_motif_consensus">
      <script>print_doc("pop_motif_consensus", "motif-consensus");</script>
      <div class="pop_close">[<a href="javascript:help_popup()">close</a> ]</div>
    </div>

    <div class="pop_content" id="pop_query_preview">
      <p>The motif preview. On supporting browsers this will display as a motif
      logo, otherwise the <a href="javascript:help_refine('pop_motif_consensus')">consensus</a> sequence will be displayed.</p>
      <div class="pop_close">[<a href="javascript:help_popup()">close</a> ]</div>
    </div>

    <div class="pop_content" id="pop_query_matches">
      <p>The number motifs in the target database with a significant match to the query motif.</p>
      <div class="pop_close">[<a href="javascript:help_popup()">close</a> ]</div>
    </div>

    <div class="pop_content" id="pop_query_list">
      <p>Links to the (up to) twenty target motifs with the most significant matches to the query motif.</p>
      <div class="pop_close">[<a href="javascript:help_popup()">close</a> ]</div>
    </div>

    <div class="pop_content" id="pop_db_name">
      <script>print_doc_para("pop_db_name", "motif-db", "target motifs. Tomtom removes the '.meme' file name extension, if present.");</script>
    <div class="pop_close">[<a href="javascript:help_popup()">close</a> ]</div>
    </div>
    
    <div class="pop_content" id="pop_db_used">
      <p>The number of motifs read from the motif database minus the number that
      had to be discarded due to conflicting IDs.</p>
      <div class="pop_close">[<a href="javascript:help_popup()">close</a> ]</div>
    </div>
    
    <div class="pop_content" id="pop_db_matched">
      <p>The number of motifs in this database that have a significant match to at least one of the query motifs.</p>
      <div class="pop_close">[<a href="javascript:help_popup()">close</a> ]</div>
    </div>
    
    <div class="pop_content" id="pop_match_summary">
      <p>The summary gives information about the target motif. Mouse over each
      row to show further help buttons for each specific title.</p>
      <div class="pop_close">[<a href="javascript:help_popup()">close</a> ]</div>
    </div>
    
    <div class="pop_content" id="pop_match_name">
      <p>The ID of the target motif with the optional alternate ID shown in parentheses.</p>
      <div class="pop_close">[<a href="javascript:help_popup()">close</a> ]</div>
    </div>
    
    <div class="pop_content" id="pop_match_db">
      <script>print_doc_para("pop_match_db", "motif-db", "the matched motif. Tomtom removes the '.meme' file name extension, if present.");</script>
      <div class="pop_close">[<a href="javascript:help_popup()">close</a> ]</div>
    </div>
    
    <div class="pop_content" id="pop_match_pvalue">
      <script>print_doc_para("pop_match_pvalue", "tomtom-p-value");</script>
      <div class="pop_close">[<a href="javascript:help_popup()">close</a> ]</div>
    </div>
    
    <div class="pop_content" id="pop_match_evalue">
      <script>print_doc_para("pop_match_evalue", "tomtom-E-value");</script>
      <div class="pop_close">[<a href="javascript:help_popup()">close</a> ]</div>
    </div>
    
    <div class="pop_content" id="pop_match_qvalue">
      <script>print_doc_para("pop_match_qvalue", "tomtom-q-value");</script>
      <div class="pop_close">[<a href="javascript:help_popup()">close</a> ]</div>
    </div>
    
    <div class="pop_content" id="pop_match_overlap">
      <script>print_doc_para("pop_match_overlap", "tomtom-overlap");</script>
      <div class="pop_close">[<a href="javascript:help_popup()">close</a> ]</div>
    </div>
    
    <div class="pop_content" id="pop_match_offset">
      <script>print_doc_para("pop_match_offset", "tomtom-offset");</script>
      <div class="pop_close">[<a href="javascript:help_popup()">close</a> ]</div>
    </div>
    
    <div class="pop_content" id="pop_match_orientation">
      <script>print_doc_para("pop_match_orientation", "tomtom-orientation", "<br>A value of 'Normal' means that the target motif is as it appears in the database. A value of 'Reverse Complement' means that the reverse complement of the target motif is shown.");</script>
      <div class="pop_close">[<a href="javascript:help_popup()">close</a> ]</div>
    </div>
    
    <div class="pop_content" id="pop_match_alignment">
      <p>The image shows the optimal alignment of the two motifs. The sequence logo
      of the target motif is shown aligned above the logo for the query motif.</p>
      <div class="pop_close">[<a href="javascript:help_popup()">close</a> ]</div>
    </div>
    
    <div class="pop_content" id="pop_match_download">
      <p>By clicking the link "Create custom LOGO &#8615;" a form to make custom logos 
      will be displayed. The download button can then be clicked to generate a motif
      matching the selected specifications.</p>
      <div class="pop_close">[<a href="javascript:help_popup()">close</a> ]</div>
    </div>
    
    <div class="pop_content" id="pop_dl_type">
      <p>Two image formats, png and eps, are available. The pixel based portable
      network graphic (png) format is commonly used on the Internet and the
      Encapsulated PostScript (eps) format is more suitable for publications
      that might require scaling.</p>
      <div class="pop_close">[<a href="javascript:help_popup()">close</a> ]</div>
    </div>
    
    <div class="pop_content" id="pop_dl_err">
      <p>Toggle error bars indicating the confidence of a motif based on the
      number of sites used in its creation.</p>
      <div class="pop_close">[<a href="javascript:help_popup()">close</a> ]</div>
    </div>
    
    <div class="pop_content" id="pop_dl_ssc">
      <p>Toggle adding pseudocounts for <b>S</b>mall <b>S</b>ample 
      <b>C</b>orrection.</p>
      <div class="pop_close">[<a href="javascript:help_popup()">close</a> ]</div>
    </div>
    
    <div class="pop_content" id="pop_dl_flip">
      <p>Toggle a full reverse complement of the alignment.</p>
      <div class="pop_close">[<a href="javascript:help_popup()">close</a> ]</div>
    </div>
    
    <div class="pop_content" id="pop_dl_width">
      <p>Specify the width of the generated logo.</p>
      <div class="pop_close">[<a href="javascript:help_popup()">close</a> ]</div>
    </div>

    <div class="pop_content" id="pop_dl_height">
      <p>Specify the height of the generated logo.</p>
      <div class="pop_close">[<a href="javascript:help_popup()">close</a> ]</div>
    </div>

    <div class="pop_content" id="pop_alph_name">
      <script>print_doc_para('pop_alph_name', 'alph-name', 'The ');</script>
      <div class="pop_close">[<a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <div class="pop_content" id="pop_alph_bg">
      <script>print_doc_para('pop_alph_bg', 'alph-bg', 'The ');</script>
      <div class="pop_close">[<a href="javascript:help_popup()">close</a> ]</div>
    </div>

    <!-- }}} -->
    <div id="download" class="hidden">
      <form id="logo_form" method="post" action="">
        <input type="hidden" name="program" value="Tomtom"/>
        <input type="hidden" name="motifs" id="dl_motifs" value=""/>
        <input type="hidden" name="id1" value="1"/>
        <input type="hidden" name="rc1" id="dl_rc1" value="0"/>
        <input type="hidden" name="label1" id="dl_label1" value=""/>
        <input type="hidden" name="id2" value="2"/>
        <input type="hidden" name="rc2" id="dl_rc2" value="0"/>
        <input type="hidden" name="label2" id="dl_label2" value=""/>
        <input type="hidden" name="shift" id="dl_shift" value="0"/>
        <table class="dl_opts">
          <tr>
            <th>Image Type <div class="help" data-topic="pop_dl_type"></div></th>
            <td>
              <select name="png">
                <option value="1" selected>PNG</option>
                <option value="0">EPS</option>
              </select>
            </td>
          </tr>
          <tr>
            <th>Error bars <div class="help" data-topic="pop_dl_err"></div></th>
            <td>
              <select name="errbars">
                <option value="1" selected>yes</option>
                <option value="0">no</option>
              </select>
            </td>
          </tr>
          <tr>
            <th>SSC <div class="help" data-topic="pop_dl_ssc"></div></th>
            <td>
              <select name="ssc">
                <option value="1">yes</option>
                <option value="0" selected>no</option>
              </select>
            </td>
          </tr>
          <tr>
            <th>Flip <div class="help" data-topic="pop_dl_flip"></div></th>
            <td>
              <select id="dl_flip">
                <option value="1">yes</option>
                <option value="0" selected>no</option>
              </select>
            </td>
          </tr>
          <tr>
            <th>Width <div class="help" data-topic="pop_dl_width"></div></th>
            <td>
              <input name="width" id="dl_width" type="text" size="3" placeholder="auto"/>
            </td>
          </tr>
          <tr>
            <th>Height <div class="help" data-topic="pop_dl_height"></div></th>
            <td>
              <input name="height" id="dl_height" type="text" size="3" placeholder="auto"/>
            </td>
          </tr>
        </table>
        <input type="submit" id="download_submit" value="download"/>&nbsp;&nbsp;<input type="button" id="download_cancel" value="cancel"/>
      </form>
      <script>make_logo_form()</script>
    </div>

    <div class="pad1">
    <div class="prog_logo big">
    <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAIAAABMXPacAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wLHAI4Nh+WUs4AAAA8dEVYdENvbW1lbnQAIEltYWdlIGdlbmVyYXRlZCBieSBHTlUgR2hvc3RzY3JpcHQgKGRldmljZT1wbm1yYXcpCszMtoUAACAASURBVHja7L13nF5llQf+Pee5963Te2bSew9JSCCFIh3pXVBAVxFRQF1hFdTVdV377loAKwosCoKAAtJ7D2mUhCSkZ1Km93nLvfc55/fHfd+Zd0ooyrq/z+/ze5nwSWbu3Pvc5/Rzvuc8pKp4/x9VtQgykhIWELOYCLsODCkREZQACi8EEQCBeOJ55Oe+DShUEBglEhPleIRcQBWwkLSklIXAClGAl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IYkDkBAJUUTHwjTfeEBH7tQ/XJGjnna9dTGOx2KpVq35+yZTGAyGttFLM4sVb3ZZIotyiwqLikm6lpd1//KNRpV17DBv2o4zcIDNiUYCQmYlgEBBT2ElrBdcFCL4PFrAgI9j670bD2LJl2zub3/ryy10rVz7f3BTaU7tr//7dsMYPkvKPZSMi/OCDD06ePNlyLA7X6t8hA5DEiJhZK33dtTc99ufFX1Z/ZtH/5F4FRFqDWQlLelRZMFDcf8DA3NxcIuO4ynW16yqAFQwn4VIxWmvDMH40EgnV1NRu374jHG5IA0hcAiRuWiZo0TuTH/yg/6JFiwYNGuh5nta6o3vu37TB276XBeJ93xMxzU0NS5+pys3JTsJHWjlAAAjGnRhtDBvFX9PK01cYYVOL6kVkw3W15e4n76dSpBQlTC/sR+uqqqfD4QizsVdS8XIYr/YfAPurEq+S/IlLliw555xzkuxax9EdO7XTxBTdunWbOXNmOBxq86v+fxuANidELBZj5lgsFolE7r///o5GfZMLS+fOnRcvXszMnud5nidH3tXh8FPKtY1S/lUAtm7d+uabb7700ktr166tq6trcbJt+d+RkuhIq7el/6tSyiSocX369LnoootGjRp1wgknWICh1V8/cq7vGv9LGIjFlym7B//000+XLl26du3aLVu22Fni+34SLfgakNJuYLTWwWAwEAj07du3srJy4sSJubm5duY5KYXNEXodBgC2VdRrOgzg+35dXV19fX1zc3N1dfUnn3xSW1u7Z8+eurq6aDSaRG/y8/PLyspKSkqKioqOPfbYoqKigoKCwsJCS2BJvg0dTyw89Ot/AHy3hsLr1jX2AAAAAElFTkSuQmCC" alt="Tomtom Logo">
    <h1>Tomtom</h1>
    <h2>Motif Comparison Tool</h2>
    </div>
    <p>
      For further information on how to interpret these results please access
      <a href="http://meme-suite.org/doc/tomtom-output-format.html">http://meme-suite.org/doc/tomtom-output-format.html</a>.<br />
      To get a copy of the MEME software please access 
      <a href="http://meme-suite.org">http://meme-suite.org</a>.
    </p>
    <p>If you use TOMTOM in your research, please cite the following paper:<br>
      <span class="citation">
        Shobhit Gupta, JA Stamatoyannopolous, Timothy Bailey and William Stafford Noble,
        "Quantifying similarity between motifs",
        <i>Genome Biology</i>, <b>8</b>(2):R24, 2007.
        <a href="http://genomebiology.com/2007/8/2/R24">[full text]</a>
      </span>
    </p>
    </div>

    <div class="pad2">
      <a class="jump" href="#query_motifs">Query Motifs</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a
        class="jump" href="#target_dbs">Target Databases</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a
        class="jump" href="#matches">Matches</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a
        class="jump" href="#settings">Settings</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a
        class="jump" href="#program">Program information</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a
        class="jump" href="tomtom.tsv">Results in TSV Format</a>&nbsp;<span id="results_tsv"></span>&nbsp;<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAQCAMAAAAyEe/dAAAACVBMVEX//wAAAAD////s2cV/AAAAdUlEQVQYlXVRBxLAIAhL+P+jC2HZhXcBZEWEldDsZcLIcAhHWWnK8SDcWQhMFUHdAQ1CqQ5+CWPmlHojl+nCJNRtzu4qRc3IUzmTVpXYK0nox0z0PI1stgchdK7lEv7ekhvalw8WW547Gyzedt/2/gLx8WXjXF/1AYFriNAWAAAAAElFTkSuQmCC" alt="NEW" id="new_1">
          &nbsp;&nbsp;|&nbsp;&nbsp;<a
        class="jump" href="tomtom.xml">Results in XML Format</a>
      <script>
        make_help_button($("results_tsv"), "pop_results_tsv");
      </script>
    </div>

    <div id="query_motifs" class="header">
      <h2>Query Motifs</h2>
      <span><a href="#target_dbs">Next</a>&nbsp;<a href="#">Top</a></span>
    </div>
    <div class="box">
      <table id="preview" class="preview th_ul">
        <thead>
          <tr>
          <th><span>Database <div class="help" data-topic="pop_query_db"></div></span></th>
          <th><span>ID <div class="help" data-topic="pop_query_name"></div></span></th>
          <th><span>Alt. ID <div class="help" data-topic="pop_query_alt"></div></span></th>
          <th><span>Preview <div class="help" data-topic="pop_query_preview"></div></span></th>
          <th><span>Matches <div class="help" data-topic="pop_query_matches"></div></span></th>
          <th><span>List <div class="help" data-topic="pop_query_list"></div></span></th>
          </tr>
        </thead>
        <tbody>
          <tr class="pview_row">
          <td class="pview_db"></td>
          <td class="pview_name"></td>
          <td class="pview_alt"></td>
          <td class="pview_logo"></td>
          <td class="pview_matches"></td>
          <td><div class="ml pview_list"></div></td>
          </tr>
        </tbody>
      </table>
      <script>make_preview();</script>
    </div>

    <div id="target_dbs" class="header">
      <h2>Target Databases</h2>
      <span><a href="#query_motifs">Previous</a>&nbsp;<a id="link_after_target_db" href="#">Next</a>&nbsp;<a href="#">Top</a></span>
    </div>
    <div class="box">
      <table id="tdbs" class="targets th_ul">
      <thead>
        <tr>
          <th><span>Database <div class="help" data-topic="pop_db_name"></div></span></th>
          <th><span>Used <div class="help" data-topic="pop_db_used"></div></span></th>
          <th><span>Matched <div class="help" data-topic="pop_db_matched"></div></span></th>
        </tr>
      </thead>
      <tbody>
        <tr class="db_row">
          <td class="db_name"></td>
          <td class="db_used ac"></td>
          <td class="db_matched ac"></td>
        </tr>
      </tbody>
      </table>
      <script>make_target_dbs();</script>
    </div>

    <div id="matches">
      <div class="match_box">
        <div class="header">
          <h2>Matches to <span class="query_name"></span></h2>
          <span class="links"><a class="prev" href="#">Previous</a>&nbsp;<a class="next" href="#">Next</a>&nbsp;<a href="#">Top</a></span>
        </div>
        <div class="box">
          <table class="th_ul" style="width:100%">
            <col style="width: 5em;">
            <col>
            <tbody class="match_entry">
              <tr>
                <th style="text-align:left;"><span>Summary <div class="help" data-topic="pop_match_summary"></div></span></th>
                <th style="text-align:left;"><span>Optimal Alignment <div class="help" data-topic="pop_match_alignment"></div></span></th>
              </tr>
              <tr>
                <td style="vertical-align:top">
                  <table class="match_summary">
                    <tbody>
                      <tr>
                        <th>Name <div class="help" data-topic="pop_match_name"></div></th>
                        <td class="match_name"></td>
                      </tr>
                      <tr>
                        <th>Database <div class="help" data-topic="pop_match_db"></div></th>
                        <td class="match_db"></td>
                      </tr>
                    </tbody>
                    <tbody>
                      <tr>
                        <th><i>p</i>-value <div class="help" data-topic="pop_match_pvalue"></div></th>
                        <td class="match_pvalue"></td>
                      </tr>
                      <tr>
                        <th><i>E</i>-value <div class="help" data-topic="pop_match_evalue"></div></th>
                        <td class="match_evalue"></td>
                      </tr>
                      <tr>
                        <th><i>q</i>-value <div class="help" data-topic="pop_match_qvalue"></div></th>
                        <td class="match_qvalue"></td>
                      </tr>
                    </tbody>
                    <tbody>
                      <tr>
                        <th>Overlap <div class="help" data-topic="pop_match_overlap"></div></th>
                        <td class="match_overlap"></td>
                      </tr>
                      <tr>
                        <th>Offset <div class="help" data-topic="pop_match_offset"></div></th>
                        <td class="match_offset"></td>
                      </tr>
                      <tr>
                        <th>Orientation <div class="help" data-topic="pop_match_orientation"></div></th>
                        <td class="match_orientation"></td>
                      </tr>
                    </tbody>
                  </table>
                  <a class="download_text" href="#">Show logo download options</a>
                </td>
                <td>
                  <div class="logo_container">
                    <a title="Previous query" class="prev_query">&#x2912;</a>
                    <a title="Previous match" class="prev_target">&#x21A5;</a>
                    <a title="Show logo download options" class="download_btn">&#x21D8;</a>
                    <a title="Next match" class="next_target">&#x21A7;</a>
                    <a title="Next query" class="next_query">&#x2913;</a>
                  </div>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
    </div>
    <script>make_matches();</script>

    <div id="settings" class="header">
      <h2>Settings</h2>
      <span><a id="link_before_program" href="#">Previous</a>&nbsp;<a href="#program">Next</a>&nbsp;<a href="#">Top</a></span>
    </div>
    <div class="box">
      <h4>Alphabet</h4>
      <span id="bg_source"></span>
      <span id="alpha_bg"></span>
      <script>
      {
        $("bg_source").appendChild(make_background_source("Source", data.options.background_source));
        $("alpha_bg").appendChild(make_alpha_bg_table(tomtom_alphabet));
      }
      </script>
      <h4>Other Settings</h4>
      <table id="tbl_settings" class="inputs hide_advanced">
        <tr>
          <th>Strand Handling</th>
          <td id="opt_strand">
            <span class="strand_none">Reverse complements are not possible so motifs are compared as they are provided.</span>
            <span class="strand_given">Motifs are compared as they are provided.</span>
            <span class="strand_both">Motifs may be reverse complemented before comparison to find a better match.</span>
          </td>
        </tr>
        <tr>
          <th>Distance Measure</th>
          <td id="opt_dist">
            <span class="dist_allr">Average log-likelihood ratio</span>
            <span class="dist_ed">Euclidean distance</span>
            <span class="dist_kullback">Kullback-Leibler divergence</span>
            <span class="dist_pearson">Pearson correlation coefficient</span>
            <span class="dist_sandelin">Sandelin-Wasserman function</span>
            <span class="dist_blic1">Bayesian Likelihood 2-Components score (from 1-component Dirichlet prior)</span>
            <span class="dist_blic5">Bayesian Likelihood 2-Components score (from 5-component Dirichlet prior)</span>
            <span class="dist_llr1">Log likelihood Ratio score (from 1-component Dirichlet prior)</span>
            <span class="dist_llr5">Log likelihood Ratio score (from 5-component Dirichlet prior)</span>
          </td>
        </tr>
        <tr>
          <th>Match Threshold</th>
          <td id="opt_ttype">
            Matches must have a <span class="ttype_evalue"><i>E</i>-value</span><span class="ttype_qvalue">q-value</span> of <span id="opt_thresh"></span> or smaller.
          </td>
        </tr>
      </table>
      <script>
      {
        $("opt_strand").className = (tomtom_alphabet.has_complement() ? (data.options.strands == "both" ? "both" : "given") : "none");
        $("opt_dist").className = data.options.distance_measure;
        $("opt_ttype").className = data.options.threshold_type;
        $("opt_thresh").textContent = data.options.threshold_value;
      }
      </script>
    </div>

    <div id="program" class="bar">
      <div style="text-align:right;"><a href="#settings">Previous</a> <a href="#">Top</a></div>
      <div class="subsection">
        <h5>TOMTOM version</h5>
        <span id="version"></span> (Release date: <span id="release"></span>)
      </div>
      <div class="subsection">
        <h5>Reference</h5>
        <span class="citation">
          Shobhit Gupta, JA Stamatoyannopolous, Timothy Bailey and William Stafford Noble,
          "Quantifying similarity between motifs",
          <i>Genome Biology</i>, <b>8</b>(2):R24, 2007.
        </span>
      </div>
      <div class="subsection">
        <h5>Command line</h5>
        <textarea id="cmd" rows="1" style="width:100%;" readonly></textarea><br>
        <br>Result calculation took <span id="runtime"></span> seconds<br>
      </div>
    </div>
    <script>make_program();</script>
  </body>
</html>
